edu.gwu.algtest
Class TreeNode

java.lang.Object
  |
  +--edu.gwu.algtest.ComparableKeyValuePair
        |
        +--edu.gwu.algtest.TreeNode

public class TreeNode
extends edu.gwu.algtest.ComparableKeyValuePair


Field Summary
 int height
           
 int ID
           
 TreeNode left
           
 TreeNode parent
           
 TreeNode right
           
 
Fields inherited from class edu.gwu.algtest.ComparableKeyValuePair
key, value
 
Constructor Summary
TreeNode()
           
TreeNode(java.lang.Comparable key, java.lang.Object value)
           
TreeNode(java.lang.Comparable key, java.lang.Object value, TreeNode left, TreeNode right, TreeNode parent)
           
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

left

public TreeNode left
Pointer to the left child, if any.

right

public TreeNode right
Pointer to the right child, if any.

parent

public TreeNode parent
Pointer to the parent, if any.

height

public int height
Used in AVL trees.

ID

public int ID
The ID is different for every node. It is sometimes useful in debugging and is included in the toString output.

Constructor Detail

TreeNode

public TreeNode()

TreeNode

public TreeNode(java.lang.Comparable key,
                java.lang.Object value)

TreeNode

public TreeNode(java.lang.Comparable key,
                java.lang.Object value,
                TreeNode left,
                TreeNode right,
                TreeNode parent)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class edu.gwu.algtest.ComparableKeyValuePair