This assignment tests on 3 areas: designing code to use inheritance, coding an abstract data type, and incorporating these concepts into the creation of a binary search tree. In assignment nbr. 3 you are to create a binary search tree of nodes using a template format that will accept ints, floats and longs as the data elements. Create two base classes. One a class that encapsulates the data and pointer variables into a Node class. The other, a Tree class that encapsulates the pointer to the start of the tree and all mutator and accessor methods. Create a tree of 21 elements at program start. Be sure to balance the tree. Then, present the user with a menu that allows a user to: 1 - insert a node into the tree ( this should be 1 method, only). The user should be asked to input the value of the node. Don't allow duplicate values to be entered. 2- delete any single node. Again, print the tree and ask the user which node to remove. 3- check for the existence of any node value. The user should be asked for the value to find. If the value is in the tree , print a message similar to " node value 55 is the 3rd element in the tree" or " node value 109 not found in the tree". 4- print the entire tree. 5- clear the tree, i.e. remove all nodes from the tree and reset the start pointer to Null. You are to create a derived class that will accomplish this task. This will be a class derived from the Tree class. Remember, all nodes must be individually removed using the "delete" operator and the start pointer must be set to null. When the user chooses to clear the tree, ask if the tree is to be reinitialized. If the users chooses "yes" you are to use the "srand" and "rand" methods to create a new tree of 20 nodes attached to a root node with a value in the middle of the range of values to be added. For example, start a tree with a value of 50 as the first value. Then add random values around this root value. The menu should allow the user to change the primitive data type (i.e. show ints, floats and longs). NOTE: you are to include all the menu items and have them do exactly what is requested. This is called, in the programming community, as designing to spec.
## Deliverables
Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. You can keep the copyright, I just need this code to get through with my course.
## Platform
The code needs to run with no errors and no warnings on Microsoft Visual C++ 6.0 on PC systems.
## Deadline information
Money is not an issue.