|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.AbstractStructure structure.BinarySearchTree structure.SplayTree
public class SplayTree
An implementation of binary search trees, based on a splay operation by Tarjan et al. An extension of the binary search tree class.
Constructor Summary | |
---|---|
SplayTree()
Construct an empty search tree. |
|
SplayTree(Comparator alternateOrder)
Construct an empty search tree. |
Method Summary | |
---|---|
void |
add(Object val)
Add a value to the splay tree. |
boolean |
contains(Object val)
Determine if a particular value is within the search tree. |
Object |
get(Object val)
Fetch a reference to the comparable value in the tree. |
Iterator |
iterator()
Construct an inorder traversal of the elements in the splay tree. |
Object |
remove(Object val)
Remove a comparable value from the tree. |
String |
toString()
Construct a string that represents the splay tree. |
Methods inherited from class structure.BinarySearchTree |
---|
clear, isEmpty, size |
Methods inherited from class structure.AbstractStructure |
---|
elements, hashCode, values |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface structure.Structure |
---|
clear, elements, isEmpty, size, values |
Constructor Detail |
---|
public SplayTree()
public SplayTree(Comparator alternateOrder)
alternateOrder
- the ordering imposed on the values insertedMethod Detail |
---|
public void add(Object val)
add
in interface Structure
add
in class BinarySearchTree
val
- The value to be added.public boolean contains(Object val)
contains
in interface Structure
contains
in class BinarySearchTree
val
- The comparable value to be found.
public Object get(Object val)
get
in class BinarySearchTree
val
- The value to be sought in tree.
public Object remove(Object val)
remove
in interface Structure
remove
in class BinarySearchTree
val
- The value to be removed.
public Iterator iterator()
iterator
in interface Structure
iterator
in class BinarySearchTree
AbstractIterator
,
Iterator
,
Enumeration
,
Structure.elements()
public String toString()
toString
in class BinarySearchTree
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |