An AVL tree implementation with a TopKMachine class laying on top. It will behave exactly like an AVL tree if you initialize the TopKMachine object with a large enough int K. Or you could simply use the two INode interface implementations. They are the essentially the AVL tree.