AVL
Class Node<Key,Data>

java.lang.Object
  extended by AVL.Node<Key,Data>

public class Node<Key,Data>
extends java.lang.Object

The node of an AVL Tree.


Field Summary
 int bf
          The node's balanceFactor.
 Data data
          The the data stored in the node.
 Key key
          The key of the data stored in the node.
 Node<Key,Data> left
          The node's left child.
 Node<Key,Data> parent
          The node's parent.
 Node<Key,Data> right
          The node's right child.
 
Constructor Summary
Node(Key key, Data data)
          Node constructot.
 
Method Summary
 java.lang.String toString()
          Returns the node as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

public Data data
The the data stored in the node.


key

public Key key
The key of the data stored in the node.


parent

public Node<Key,Data> parent
The node's parent.


bf

public int bf
The node's balanceFactor.


left

public Node<Key,Data> left
The node's left child.


right

public Node<Key,Data> right
The node's right child.

Constructor Detail

Node

public Node(Key key,
            Data data)
Node constructot. Initializes a node with a given key and associated data. All pointers are initialized to null. The balance factor is set to 0.

Parameters:
key - Key of the new node.
data - Data to save in the node.
Method Detail

toString

public java.lang.String toString()
Returns the node as a String. The key, data and balance factor are printed.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the node contents.