Class AVLTree.TreeNode<T>

  • Type Parameters:
    T - a tree node value type
    Enclosing class:
    AVLTree<T>

    public static class AVLTree.TreeNode<T>
    extends java.lang.Object
    Container holding the values stored in the tree.
    • Method Detail

      • getValue

        public T getValue()
        Returns a value stored in this node
        Returns:
        a value stored in this node
      • getRoot

        public AVLTree.TreeNode<T> getRoot()
        Returns a root of the tree this node is stored in
        Returns:
        a root of the tree this node is stored in
      • getSubtreeMin

        public AVLTree.TreeNode<T> getSubtreeMin()
        Returns a minimum node stored in the subtree rooted at this node
        Returns:
        a minimum node stored in the subtree rooted at this node
      • getSubtreeMax

        public AVLTree.TreeNode<T> getSubtreeMax()
        Returns a maximum node stored in the subtree rooted at this node
        Returns:
        a maximum node stored in the subtree rooted at this node
      • getTreeMin

        public AVLTree.TreeNode<T> getTreeMin()
        Returns a minimum node stored in the tree
        Returns:
        a minimum node stored in the tree
      • getTreeMax

        public AVLTree.TreeNode<T> getTreeMax()
        Returns a maximum node stored in the tree
        Returns:
        a maximum node stored in the tree
      • getParent

        public AVLTree.TreeNode<T> getParent()
        Returns a parent of this node
        Returns:
        a parent of this node
      • getLeft

        public AVLTree.TreeNode<T> getLeft()
        Returns a left child of this node
        Returns:
        a left child of this node
      • getRight

        public AVLTree.TreeNode<T> getRight()
        Returns a right child of this node
        Returns:
        a right child of this node
      • getSuccessor

        public AVLTree.TreeNode<T> getSuccessor()
        Returns a successor of this node according to the tree in order traversal, or null if this node is a maximum node in the tree
        Returns:
        successor of this node, or null if this node in a maximum node in the tree
      • getPredecessor

        public AVLTree.TreeNode<T> getPredecessor()
        Returns a predecessor of this node according to the tree in order traversal, or null if this node is a minimum node in the tree
        Returns:
        predecessor of this node, or null if this node in a minimum node in the tree
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object