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

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

public class BTNode<T extends Comparable<? super T>> extends Object
Simple implementation of a Binary Tree Node
See Also:
  • Constructor Details

    • BTNode

      public BTNode(T value)
      Creates a node with only the data
      the left and right node are empty
      Parameters:
      value - The data of this node
    • BTNode

      public BTNode(T value, BTNode<T> l, BTNode<T> r)
      Creates a node that has child nodes
      Parameters:
      value - The data of this node
      l - The left subtree
      r - The right subtree
  • Method Details

    • getData

      public T getData()
      Gets the data from this Node
      Returns:
      The data
    • setData

      public void setData(T value)
      Sets the data of this node
      Parameters:
      value - The data