|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.pow2.structures.tree.BinaryTree com.pow2.structures.tree.BinarySearchTree
Binary search tree class.
Traverse this tree using post-order algorithm.
Field Summary |
Fields inherited from class com.pow2.structures.tree.BinaryTree |
cat, INTRAVERSE, nodeVisitor, POSTRAVERSE, PRETRAVERSE, root, traverseMode |
Constructor Summary | |
BinarySearchTree()
Constructor for the BinarySearchTree object |
|
BinarySearchTree(Object o)
Constructor for the BinarySearchTree object |
Method Summary | |
void |
build()
Build the tree |
void |
insert(Comparable o)
Insert a Comparable object into the tree. |
void |
visit(Node n)
Visit the content of the input node. |
Methods inherited from class com.pow2.structures.tree.BinaryTree |
addLeft, addRight, getData, getLeft, getNodeVisitor, getRight, getRoot, getTraverseMode, insertLeft, insertRight, intrav, isEmpty, move, postrav, pretrav, remove, remove, setData, setNodeVisitor, setRoot, setTraverseMode, traverse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BinarySearchTree()
public BinarySearchTree(Object o)
o
- the root node of the tree.Method Detail |
public void insert(Comparable o)
o
- the Comparable object to insert.public void visit(Node n)
visit
in class BinaryTree
n
- the node to visitpublic void build()
build
in class BinaryTree
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |