Question: Homework # 4 builds upon Homework # 3 . You will convert the BST implemented in Homework # 3 into an AVL tree. Your program
Homework # builds upon Homework # You will convert the BST implemented in Homework # into an AVL tree. Your program will appear the same as HW# to the user except that the "Display list" menu option will additionally display the balance factor for each node within the tree. The Root of the tree will be indicated as such. Recall from class discussion that the balance factor of a node is the absolute difference in height between its left and right child nodes ie subtrees Program Structure and Design displayList and displayAliasesForLocation shall be based on Inorder Traversal. displayList will display the alias, address, height, depth, balance factor, and parents alias for each node. deleteAddress lookUpAddress and displayAliasesForLocation will display an error message if the alias or location entered is not listed. Following the error message, the menu will be redisplayed. A separate UDF will be defined as an entry point for each menu option. These functions must each be properly prototyped and documented as discussed. No duplicate aliases or address are allowed. If attempted, display an appropriate error message followed by the menu. For this exercise, all aliases entered by the user must be converted by your program to lower case. In addition to the UDFs contained within HW# you should also include the following UDFs you may design your own function prototypes rebalanceNode n rotateLeftNode n rotateRightNode n rotateLeftThenRightNode n rotateRightThenLeftNode n Rubric points Is the source code well documented and formatted using clearly readable indentation and white space while viewed within vi point Is the AVL Tree and associated recursion properly implemented? points displayList must display the correct alias, address, height, depth, balance factor, and parents alias for each node in order to receive credit. points Does each menu option map to its own UDF, and is each UDF properly implemented and prototyped? points global variable may be used. Each additional global variable will cost point Error Log entries not omitted from the BST will cost point Note: Your program must compile using gccunix in order to receive credit
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
