view NGSrich_0.5.5/src/datastructures/AVLNode.java @ 0:89ad0a9cca52 default tip

Uploaded
author pfrommolt
date Mon, 21 Nov 2011 08:12:19 -0500
parents
children
line wrap: on
line source

package datastructures;


// Basic node stored in AVL trees
// Note that this class is not accessible outside
// of package DataStructures

class AVLNode
{
    // Constructors
	@SuppressWarnings("unchecked")
	AVLNode( Comparable theElement )
    {
        this( theElement, null, null );
    }

    @SuppressWarnings("unchecked")
	AVLNode( Comparable theElement, AVLNode lt, AVLNode rt )
    {
        element  = theElement;
        left     = lt;
        right    = rt;
        height   = 0;
    }

        // Friendly data; accessible by other package routines
    @SuppressWarnings("unchecked")
	Comparable element;      // The data in the node
    AVLNode    left;         // Left child
    AVLNode    right;        // Right child
    int        height;       // Height
}