CS311 Project 2: An AVL-balanced Tree
Due Monday, March 31 (right after Spring Break)
Create an AVL-balanced binary tree ADT that will function as a set. This should be a template class, capable of holding any type of data that can be compared. You can assume that the comparison operators work for the data added to the tree (this is a common constraint for tree classes). The tree should support at least these methods:
- insert, which will insert a node into the tree
- remove, which will remove a node from the tree
- contains, which will return true/false depending on if the indicated item is in the tree or not
- Some sort of display method which convincingly demonstrates that the tree is AVL-balanced after additions and deletions. I'd recommend retaining the graphviz solution that we'll use in class examples, but any solution is ok here, even ASCII art.
Feel free to borrow any code you like from the class examples. Review the wikipedia page on AVL trees. It contains a number of examples which may be useful.