|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--csc241.samples.Set.Tree
Field Summary | |
protected treeNode |
root_
|
protected int |
size_
|
Constructor Summary | |
Tree()
Construct an empty Binary Search Treee |
Method Summary | |
void |
add(java.lang.Comparable e)
add an element to the Tree. |
void |
dump()
The tree content is displayed in the form of a tree turned counterclockwise 90 degrees. |
java.lang.Comparable |
find(java.lang.Comparable e)
find and return the element in the set or return null if the element is not in the set. |
void |
remove(java.lang.Comparable e)
remove an element from the Tree; do nothing if element no in there. e - the element to be removed |
int |
size()
return the size of the set (i.e. |
java.lang.Comparable[] |
toArray()
The toArray method creates and returns an array containing all elements in the tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected treeNode root_
protected int size_
Constructor Detail |
public Tree()
Method Detail |
public void add(java.lang.Comparable e)
add
in interface Set
public void remove(java.lang.Comparable e)
remove
in interface Set
public java.lang.Comparable find(java.lang.Comparable e)
find
in interface Set
public int size()
size
in interface Set
public java.lang.Comparable[] toArray()
toArray
in interface Set
public void dump()
dump
in interface Set
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |