Question: Implement a AVL Search Tree. The AVL Search Tree should be in its own file, with all related classes internal to the AVL class as

Implement a AVL Search Tree. The AVL Search Tree should be in its own file, with all related classes internal to the AVL class as private classes. The AVL Search Tree needs to be able to contain comparable items. You can do this using generics. The AVL Tree must contain the following methods boolean contains(Key k) - returns true if k is in the AVL. false if not. void insert(Key k) - inserts k into the AVL in the appropriate spot. boolean delete(Key k) - removes k from the AVL if it exists, returns false if it is not in the tree. inorder() - Prints a well formatted in order visit of every node in the AVL. preorder() - Prints a well formatted pre order visit of every node in the AVL. postorder() - Prints a well formatted post order visit of every node in the AVL.

implement a toString method which will print the following:

Level #:List of nodes in the level

Example: AVL tree looks like

0 1 2

Level 0 - 0 Level 1 - 1, 2

*Use Java for the code*

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 Databases Questions!