|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectavlbinarysearchtree.AVLBinaryTree<E>
public class AVLBinaryTree<E>
This Class is to be used as a Generic AVLTree in your application
| Field Summary | |
|---|---|
static int |
INORDER
This To Specify Tree values inorder |
static int |
POSTORDER
This To Specify Tree values postorder |
static int |
PREORDER
This To Specify Tree values preorder |
| Constructor Summary | |
|---|---|
AVLBinaryTree()
Default Constructor |
|
AVLBinaryTree(boolean DUPLICATES)
AVLTree Constructor |
|
| Method Summary | ||
|---|---|---|
boolean |
add(E obj)
Adds New Element To The Tree |
|
boolean |
contains(E obj)
Checks if the object is found in the tree or not |
|
E |
get(E obj)
Reutrns a refence to the object if found in the tree |
|
E |
getMax()
Reutrns a refence to the max object in the tree |
|
E |
getMin()
Reutrns a refence to the min object in the tree |
|
int |
getSize()
return the number of nodes in the tree |
|
boolean |
isEmpty()
checks if tree is empty |
|
java.lang.String |
printTree()
Prints The Tree Values |
|
java.lang.String |
printTree(int ORDER)
Prints The Tree Values In The Specified Order |
|
java.lang.String |
printTree(int ORDER,
java.lang.String seperator)
Prints The Tree Values In The Specified Order and defines a new seperator to be used |
|
java.lang.String |
printTree(java.lang.String seperator)
Prints The Tree Values |
|
boolean |
remove(E obj)
Removes Element From The Tree |
|
boolean |
removeAll()
This is to clear the AVLTree |
|
void |
setDuplicates(boolean DUPLICATES)
allow duplicate values to be added to the tree if true parameter is given |
|
java.lang.Object[] |
toArray()
Returns an array contains all values specified in the tree |
|
java.lang.Object[] |
toArray(int ORDER)
Returns an array contains all values specified in the tree but in a specified order |
|
|
toArray(T[] a)
Method used to Returns An Array Of The Tree Values Object type |
|
|
toArray(T[] a,
int ORDER)
Method used to Returns An Array Of The Tree Values Object type but in a specified order |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int INORDER
public static final int POSTORDER
public static final int PREORDER
| Constructor Detail |
|---|
public AVLBinaryTree()
public AVLBinaryTree(boolean DUPLICATES)
DUPLICATES - this is used to allow AVLTree to add the same value
more than once| Method Detail |
|---|
public boolean removeAll()
public boolean add(E obj)
obj - object added to the tree and implements comparable
public boolean remove(E obj)
obj - object which will be removed if found in the tree
which implements comparable
public java.lang.String printTree()
public java.lang.String printTree(java.lang.String seperator)
seperator - string value to seperate between tree values
public java.lang.String printTree(int ORDER)
ORDER -
public java.lang.String printTree(int ORDER,
java.lang.String seperator)
ORDER - order of printingseperator - the seperator to seperate tree values
public boolean contains(E obj)
obj - check if the tree has this object or not
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
a - the object to get values in it's type
public java.lang.Object[] toArray(int ORDER)
ORDER - order type
public <T> T[] toArray(T[] a,
int ORDER)
a - the object typeORDER - order type
public E getMin()
public E getMax()
public E get(E obj)
obj -
public int getSize()
public boolean isEmpty()
public void setDuplicates(boolean DUPLICATES)
DUPLICATES - sets the DUplicates values allaowance
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||