Description
EXPERIMENT 11 – BINARY SEARCH TREE
IMPORTANT REMINDERS
1. It is not allowed to use USB sticks during the lab sessions.
2. You should unplug your ethernet cables during the lab sessions.
3. Any reference book or help material (C++) is allowed.
Consider the phone book example covered in the class. In this example, every node in the tree stores the following: name (char*), phonenum (char*), left (Phone_node*) and right (Phone_node*). Add, print, search, update (only updates name of the contact) and delete operations are maintained with a menu when the program is terminated.
In this experiment, you are required to extend this example by allowing multiple phone numbers for a specific person. To do so, you need to use a linked list for each contact in the tree and this list should store the numbers of related person. For better understanding, you can see an illusturaiton of the mentioned structure.
Structure of a contact in the tree
Hint: In add method, you should first check if the new contact has already been added to the tree before. If so, you should just add the new number type to the linked list of the contact (you can assume that a new number node is always added to the end of the linked list).
Otherwise, you should follow the add rules of the Binary Search Tree.




Reviews
There are no reviews yet.