|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--tree.MyTree
This is a binary search tree. The tree holds integer valued nodes.
MyNode
Constructor Summary | |
MyTree()
Class constructor. |
Method Summary | |
int |
cardinal()
Calculate the number of nodes in this tree. |
MyNode |
getRoot()
Return a reference to the root in this tree. |
boolean |
insert(MyNode node)
Inserts a node in this tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MyTree()
Method Detail |
public MyNode getRoot()
public boolean insert(MyNode node)
node
- The node to insert in this tree.public int cardinal()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |