|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.splay.SplayTree<K>
public class SplayTree<K>
A generified, top-down, linked, in memory, splay tree implementation. This is an adaptation of the Danny Sleator's non-linked implementation here .
Constructor Summary | |
---|---|
SplayTree(java.util.Comparator<K> keyComparator)
|
Method Summary | |
---|---|
K |
find(K key)
Find an item in the tree. |
K |
findMax()
Find the largest item in the tree. |
K |
findMin()
Find the smallest item in the tree. |
LinkedBinaryNode<K> |
getFirst()
|
LinkedBinaryNode<K> |
getLast()
|
LinkedBinaryNode<K> |
getRoot()
|
void |
insert(K key)
Insert into the tree. |
boolean |
isEmpty()
Test if the tree is logically empty. |
static void |
main(java.lang.String[] args)
|
void |
printTree()
Prints the contents of splay tree in pretty format |
void |
remove(K key)
Remove from the tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SplayTree(java.util.Comparator<K> keyComparator)
Method Detail |
---|
public void insert(K key)
x
- the item to insert.
DuplicateItemException
- if x is already present.public void remove(K key)
x
- the item to remove.
ItemNotFoundException
- if x is not found.public K findMin()
public K findMax()
public K find(K key)
public boolean isEmpty()
public LinkedBinaryNode<K> getFirst()
public LinkedBinaryNode<K> getLast()
public LinkedBinaryNode<K> getRoot()
public void printTree()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |