/** * A simple tree structure for long values. It's nowhere near a complete tree * implementation since we don't really need one. However, if anyone is * interested in finishing this class, or optimizing it, that would be * appreciated.<p> * * The tree uses three arrays to keep the tree structure. It works as in the * following example: * * <pre> * 1 * |-- 3 * |-- |--4 * |-- |--6 * |-- 5 * * array index: 0 | 1 | 2 | 3 | 4 * * key: 1 | 3 | 4 | 5 | 6 * leftChild: 1 | 2 |-1 |-1 |-1 * rightChild -1 | 3 | 4 |-1 |-1 * </pre> * * Where the key array holds key values, and the leftChild and rightChild arrays * are pointers to other array indices.<p> * * The tree holds a maximum of 65534 nodes. It is not intended to be thread-safe. * Based on algorithm found in the book "Introduction To Algorithms" by Cormen * et all, MIT Press, 1997. * * @author Matt Tucker */