Homework 7 - AVL Trees (Extra Credit)

Due: Wednesday June 4, 2008 at 5:00pm
This is an extra-credit assignment. No late assignments will be accepted.
This homework is worth 20 points.

Modify BST.h from Lab 6 to implement the AVL tree insertions. You will need to implement the left rotation, right rotation, left-right rotation and right-left rotation. Additionally, you will need to add balance factors to each node so that insert can detect when a rotation is needed and determine which rotation to perform.

Test your AVL code with hw7main.cpp.