Campers are enrolling and withdrawing from camp faster than


The director of Camp Posanivee is frustrated. Campers are enrolling and withdrawing from camp faster than her primitive filing system can handle, and she has turned to you. You have been offered free meals at the mess hall in return for a program that will help her keep track of who is enrolled for the two-week summer camp.

Your program will use a binary search tree to maintain the set of campers enrolled in Camp Posanivee. Your program should not be case-sensitive.

Your program will consist of a loop to process commands. The commands should come from a text file (say, "camp.txt"). The program quits when the command 'Q' is given. Below is a list of commands your program should support:

H Help: print a list of commands

E name age gender Enroll a new camper (insert)

W name Withdraw a camper (delete)

D name Display the age and gender of a camper

A Print the average age of the campers

L List all campers names in alphabetical order

S Print the number of boy and girl campers

P List all campers names in preorder

Q Quit

Here name is a string of at most 20 non-blank characters, age is an integer, and gender is either M or F. You may assume command arguments are separated by one or more spaces.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Campers are enrolling and withdrawing from camp faster than
Reference No:- TGS0932388

Now Priced at $45 (50% Discount)

Recommended (96%)

Rated (4.8/5)