public void seekTo(final TNode root, final Object key,
      final AvlKeyComparator<TNode> keyComparator) {
      current = null;
      height = 0;

      TNode node = root;
      while (node != null) {
        if (keyComparator.compareKey(node, key) >= 0) {
          if (node.avlLeft != null) {
            stack[height++] = node;
            node = (TNode) node.avlLeft;
          } else {
            current = node;
            return;
          }
        } else {
          if (node.avlRight != null) {
            stack[height++] = node;
            node = (TNode) node.avlRight;
          } else {
            if (height > 0) {
              TNode parent = (TNode) stack[--height];
              while (node == parent.avlRight) {
                if (height == 0) {
                  current = null;
                  return;
                }
                node = parent;
                parent = (TNode) stack[--height];
              }
              current = parent;
              return;
            }
            current = null;
            return;
          }
        }
      }
    }
Reset the iterator, and seeks to the specified key
@param root          the current root of the tree
@param key           the key for the node we are trying to find
@param keyComparator the comparator to use to match node and key
hbase-common/src/main/java/org/apache/hadoop/hbase/util/AvlUtil.java