Binary Tree Database This is very similar to assignment 4, but it has been adapted for trees instead of linked lists. The database files that you used for one of the introduction to programming labs are coming back again. They all follow this format: 10081957 101440980 Betty Lamprey NY 24061927 103980155 Pinky Fellowes OR 14031947 106100903 Oliver Kringle ND 05011948 108690448 Larry Brown KS 28101964 111180924 Adolf Davies UT 27021971 112200747 Bella Napster OK 16071973 112550407 Marianne Stone OR 04051957 113070570 Apu Mitchell TX 23101940 113220519 Jilly Aston WY 07061967 114680858 Matilda Vincent MI One person per line, and for each person we are given five things - date of birth, social security number, first name, last name, and state of residence. The birth date format is slightly different this semester. Instead of the usual YYYYMMDD, it has been switched around to DDMMYYYY, so Betty Lamprey's 10081957 means the 10th of August 1957. This URL gives you access to 9 different data files. Same format, different lengths: http://rabbit.eng.miami.edu/class/een118/labs/152/ if you are working on rabbit, you don't need to download the files into your own directory, you can access them directly like this: f.open("/home/www/class/een118/labs/152/dbfile1.txt"); You are to define four data structures: 1. A simple object to represent a person. 2. A binary tree of persons. The tree must be ordered so that a search for a person given their full name (first and last) will be very fast. 3. An object to represent a state, storing the state's name or abbreviation and the tree of all people who live in it. 4. A tree of states. This tree must be ordered by the state's name/abbreviation. Your program needs a method for adding a new person object into the main tree, this will require the creation of a new state object when you are adding the first person from any given state. Do not pre-fill the tree of states with 50 empty entries, only create a state object when/if a person residing in that state appears. Your program should be interactive, accepting and obeying the following simple commands from the user. 1. read filename e.g. "read /home/www/class/een118/labs/152/dbfile1.txt" Read the contents of the named file, adding each person to the data structures. Remember that the trees must be in alphabetical order on the persons' names. 2. states Print a list of all the states that appear in the databsae. 3. list state e.g. "list FL" Print the details of everyone from the given state, in alphabetical order 4. oldest state youngest state e.g. "oldest NY" Find and print the oldest/youngest person in the given state 5. find fname lname e.g. "find Larry Brown" Find and print the named person, not knowing which state they are in 6. merge oldstate newstate e.g. "merge NY CT" This is slightly different from the question in assignment 4. In the example, "merge NY CT", everyone in New York is buying a second home in Connecticut, so all the people in the tree for NY must be added to the tree for CT, but they must also remain in the NY tree. They will become dual residents. This is because removing from a tree is more difficult than removing from a linked list. Extra Credit Only 7. (the same as question 6 from assignment 4) move ssn oldstate newstate e.g. "move 108690448 KS MD" The person with the given social security number has moved to a diferent state. Update the data structures to reflect this change. The person must be removed from their old state's tree.