|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weiss.nonstandard.SplayTree
Implements a top-down splay tree. Note that all "matching" is based on the compareTo method.
Constructor Summary | |
SplayTree()
Construct the tree. |
Method Summary | |
java.lang.Comparable |
find(java.lang.Comparable x)
Find an item in the tree. |
java.lang.Comparable |
findMax()
Find the largest item in the tree. |
java.lang.Comparable |
findMin()
Find the smallest item in the tree. |
void |
insert(java.lang.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 |
remove(java.lang.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 SplayTree()
Method Detail |
public void insert(java.lang.Comparable x)
x
- the item to insert.DuplicateItemException
- if x is already present.public void remove(java.lang.Comparable x)
x
- the item to remove.ItemNotFoundException
- if x is not found.public java.lang.Comparable findMin()
public java.lang.Comparable findMax()
public java.lang.Comparable find(java.lang.Comparable x)
x
- the item to search for.public void makeEmpty()
public boolean isEmpty()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |