A board of education maintains a database of substitute teachers in the area. If a temporary is necessary for a certain subject, an available teacher is sent to the school that requests him or her. Write a menu-driven program maintaing this database.
The file substitutes list the first and last names of the substitute teachers, an indication of whether or not they are currently available (Y(es) or N(o)), and a list of numbers that represents the subjects they can teach. An example of substitutes is
Hilliard Roy Y 0 4 5
Ennis John N 2 3
Nelson William Y 1 2 4 5
Baird Lyle Y 1 3 4 5
Geiger Melissa N 3 5
Kessel Warren Y 3 4 5
Scherer Vincent Y 4 5
Hester Gary N 0 1 2 4
Linke Jerome Y 0 1
Thornton Richard N 2 3 5
Create a class *teacher* with three data members: index, left child, and right child. Declare an array subjects with the same number of cells as the number of subjects, each cell storing a pointer to class *Teacher*, which is really a pointer to the root of a binary search tree of teachers teaching a giving subject. Also, delcare an array *names* with each cell holding one entry from the file.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
First, prepare the array names to create binary serach trees. To do that, load all entries from substitutes to names and sort names using one of an algorithm (a sort). Afterward, create a binary tree using the function balance(). Go through the array names, and for each subject associated with each name, create a node in the tree corresponding to this subject. The index field of such a node indicates a location in names of a teacher teaching this subject. (Note that insert() in balance() should be able to go to a proper tree.)
CODE SHOULD BE COMMENTED... COMPILE IN DEV C++4.0