|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAATree<T>
public class AATree<T extends java.lang.Comparable<? super T>>
Nested Class Summary | |
---|---|
class |
AATree.BinaryNode
|
Field Summary | |
---|---|
AATree.BinaryNode |
root
|
int |
rotationCount
|
Constructor Summary | |
---|---|
AATree()
Constructor for an empty tree. |
Method Summary | |
---|---|
void |
find(T e)
|
boolean |
insert(T element)
This is the only method that enables the user to add elements to the AA tree. |
boolean |
remove(T element)
This method enables a user to remove an element from the AA tree. |
int |
size()
The method returns the number of nodes in the tree. |
java.lang.Object[] |
toArray()
This method returns an array containing all elements in the tree. |
java.util.ArrayList<java.lang.Object> |
toArrayList()
This method returns an ArrayList containing all elements in the tree. |
java.lang.String |
toString()
This method produces a string representation of all elements in the tree. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public AATree.BinaryNode root
public int rotationCount
Constructor Detail |
---|
public AATree()
Method Detail |
---|
public void find(T e)
public boolean insert(T element)
element
- The only parameter is the element to be added to the tree.
It has to be of the parameterized type Comparable that was used to create
the tree.
public boolean remove(T element)
element
- The only parameter is the element to be added to the tree.
It has to be of the parameterized type Comparable that was used to create
the tree.
public java.lang.String toString()
toString
in class java.lang.Object
public int size()
public java.lang.Object[] toArray()
public java.util.ArrayList<java.lang.Object> toArrayList()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |