Class AVLNode<T extends Comparable<? super T>>

java.lang.Object
com.thomas.trees.BTNode<T>
com.thomas.trees.AVLNode<T>
Type Parameters:
T - The type of the Node

public class AVLNode<T extends Comparable<? super T>> extends BTNode<T>
Simple implemenation of a AVL Tree node
See Also:
  • Constructor Details

    • AVLNode

      public AVLNode(T value)
      Creates a node without any children
      Parameters:
      value - The data value for the node
    • AVLNode

      public AVLNode(T value, AVLNode<T> l, AVLNode<T> r)
      Creates a node with children
      Parameters:
      value - The data value for this node
      l - The left subtree
      r - The right subtree
  • Method Details

    • setHeight

      public void setHeight(int newHeight)
      Sets the height of the node
      Parameters:
      newHeight - The new height
    • getHeight

      public int getHeight()
      Gets the height of the node
      Returns:
      The height of the node
    • getLeft

      public AVLNode<T> getLeft()
      Gets the left node
      Returns:
      The left subtree
    • getRight

      public AVLNode<T> getRight()
      Gets the right node
      Returns:
      The right subtree