This is my implementation of an AVL Tree for integers.
Part of my coursework consisted on implementing a binary tree and the additional challenge was developing an AVL Tree.
- Supports adding integers into the tree.
- Searching for items takes O(log n).
This was developed using IntelliJ IDEA.
Includes a main method for testing purposes as well as print statements to indicate the type of rotation being carried out when inserting elements. The program will print all the nodes in Breadth first order after every rotation to show what the tree looks like.
- Add support for removal of items.
This is the output to the screen after inserting all the elements included in the main method.
This is what the tree looks like.