|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.olemiss.cs211.BinarySearchTree<T>
T
- public class BinarySearchTree<T extends java.lang.Comparable<T>>
Binary Search Tree implementation
Constructor Summary | |
---|---|
BinarySearchTree()
Creates an empty binary search Tree |
Method Summary | |
---|---|
boolean |
add(T element)
Inserts an element of type T into the Binary Search Tree |
boolean |
find(T element)
searches the binary search tree recursively for the element |
boolean |
isEmpty()
method to check if the Tree is empty |
void |
printInorder()
prints the data in the nodes encountered during the in-order traversal of the tree |
void |
printLevelOrder()
prints the data in the nodes encountered during the level-order traversal of the tree |
void |
printPostorder()
prints the data in the nodes encountered during the post-order traversal of the tree |
void |
printPreorder()
prints the data in the nodes encountered during the pre-order traversal of the tree |
int |
size()
method that |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinarySearchTree()
Method Detail |
---|
public int size()
public boolean isEmpty()
public boolean add(T element)
element
- of comparable type T
public boolean find(T element)
element
-
public void printPreorder()
public void printInorder()
public void printPostorder()
public void printLevelOrder()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |