Mercurial > repos > pfrommolt > ngsrich
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/NGSrich_0.5.5/src/datastructures/AVLNode.java Mon Nov 21 08:12:19 2011 -0500 @@ -0,0 +1,32 @@ +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 +}