asd_library.tree.avltree
Class AvlNode

java.lang.Object
  |
  +--asd_library.tree.avltree.AvlNode

public class AvlNode
extends java.lang.Object

Basic node stored in AVL trees


Field Summary
protected  java.lang.Comparable element
          The data in the node
protected  int height
          Height
protected  AvlNode left
          Left child
protected  AvlNode right
          Right child
 
Constructor Summary
(package private) AvlNode(java.lang.Comparable theElement)
          Creates a new node without children.
(package private) AvlNode(java.lang.Comparable theElement, AvlNode lt, AvlNode rt)
          Creates a new node with children and heigth equals to zero
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

element

protected java.lang.Comparable element
The data in the node


left

protected AvlNode left
Left child


right

protected AvlNode right
Right child


height

protected int height
Height

Constructor Detail

AvlNode

AvlNode(java.lang.Comparable theElement)
Creates a new node without children.

Parameters:
theElement - to insert.

AvlNode

AvlNode(java.lang.Comparable theElement,
        AvlNode lt,
        AvlNode rt)
Creates a new node with children and heigth equals to zero

Parameters:
theElement - the key of the node.
lt - the left child.
rt - the right child.