Data Structures and Algorithms

Lab 11 - AVL Tree

Base on your Lab10 implementation of a binary search tree data structure, implement an AVL tree data structure.
Write a main function to test your implementation step-by-step.
Hint: implement the following methods and use them when modifying the existing insert(), delete()...
  1. int height(Node),
  2. void rotateLeft(Node),
  3. void rotateRight(Node),
  4. void balance(Node) // if the subtree is unbalanced then balance it by rotating