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 Object-Oriented Program (OOP) by using class or struct/objects 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:
15,18,10,7,57,6,13,12,9,65,19,16,23
You should perform more test with different data sets.
Sample output attached.
Write a C + + program to build an AVL tree by

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!