The AVL is the first self-balancing binary search tree invented. This is my implementation. It styles itself after the STL set, using templates to be able to store any kind of data as long as it has an order relation defined. It has most of the functionalities you would expect from a binary search tree.