Question: Write a C + + program to build an AVL tree by accepting the integers input from users. For each input, balance the tree and
Write a C program to build an AVL tree by accepting the integers input from users. For each input, balance the tree and display it on the screen; you then calculate the preorder, inorder and postorder traversals as well. Apply ObjectOriented Program OOP by using class or structobjects and separating the source code into multiple files.There should be a menu to drive the program. It should be similar as follows:
AVL Tree Implementation
A: Insert an integer to a tree and show the balanced tree at each insertion.
B: Display the balanced tree and show preorder traversal.
C: Display the balanced tree and show inorder traversal.
D: Display the balanced tree and show postorder traversal.
E: Exit
To be sure, your program is correctly working, use the following data to test AVL tree:
You should perform more test with different data sets.
Sample output attached.
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
