|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweiss.nonstandard.AATree<AnyType>
public class AATree<AnyType extends java.lang.Comparable<? super AnyType>>
Implements an AA-tree. Note that all "matching" is based on the compareTo method.
Constructor Summary | |
---|---|
AATree()
Construct the tree. |
Method Summary | |
---|---|
AnyType |
find(AnyType x)
Find an item in the tree. |
AnyType |
findMax()
Find the largest item in the tree. |
AnyType |
findMin()
Find the smallest item in the tree. |
void |
insert(AnyType 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(AnyType 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(AnyType x)
x
- the item to insert.
DuplicateItemException
- if x is already present.public void remove(AnyType x)
x
- the item to remove.
ItemNotFoundException
- if x is not found.public AnyType findMin()
public AnyType findMax()
public AnyType find(AnyType 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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |