Question: Create a program that asks repeatedly the user positive integer numbers and stores/deletes it in an AVL tree (use the code saw in the third

Create a program that asks repeatedly the user positive integer numbers and stores/deletes it in an AVL tree (use the code saw in the third example) If the user enters a number already in the tree, delete it If the user enters a number that is not in the tree, insert it After each insertion/deletion, the program prints the current tree using the printHelper method When the user enters a non-positive integer, the program ends Besides the implementation of your program, write a short report describing your experiences


When running your code the output should be like the following:

Enter a non-positive integer to end the program. Enter a number to

Enter a non-positive integer to end the program. Enter a number to insert into the tree. Enter a number already in the tree to remove it. 10 R-10 Enter a number to insert into the tree. Enter a number already in the tree to remove it. 5 R--10 L-5 Enter a number to insert into the tree. Enter a number already in the tree to remove it. 6 R- -6 L----5 R--10 Enter a number to insert into the tree. Enter a number already in the tree to remove it. 7 R-6 R---10 L-7 Enter a number to insert into the tree. Enter a number already in the tree to remove it. 18 R- -6 L R---10 L--7 R-18 Enter a number to insert into the tree. Enter a number already in the tree to remove it. 1000 R----10 L---6 L-5 R-7 R-18 R-1000 Enter a number to insert into the tree. Enter a number already in the tree to remove it. 24 R-10 L---6 L- R- R-24 L-18 R----1000 Enter a number to insert into the tree. Enter a number already in the tree to remove it.

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!