|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DataStructures.AATree
Implements an AA-tree. Note that all "matching" is based on the compareTo method.
Constructor Summary | |
AATree()
Construct the tree. |
Method Summary | |
Comparable |
find(Comparable x)
Find an item in the tree. |
Comparable |
findMax()
Find the largest item in the tree. |
Comparable |
findMin()
Find the smallest item in the tree. |
void |
insert(Comparable x)
Insert into the tree. |
boolean |
isEmpty()
Test if the tree is logically empty. |
static void |
main(java.lang.String[] args)
|
void |
makeEmpty()
Make the tree logically empty. |
void |
printTree()
Print the tree contents in sorted order. |
void |
remove(Comparable x)
Remove from the tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AATree()
Method Detail |
public void insert(Comparable x)
x
- the item to insert.public void remove(Comparable x)
x
- the item to remove.public Comparable findMin()
public Comparable findMax()
public Comparable find(Comparable x)
x
- the item to search for.public void makeEmpty()
public boolean isEmpty()
public void printTree()
public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |