public class SplayTree
extends java.lang.Object
Constructor and Description |
---|
SplayTree() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Node |
find(Node key)
Find an item in the tree.
|
Node |
findMin()
Find the smallest item in the tree.
|
void |
insert(Node key)
Insert into the tree.
|
boolean |
isEmpty()
Test if the tree is logically empty.
|
void |
remove(Node key)
Remove from the tree.
|
public void clear()
public void insert(Node key)
key
- the item to insert.DuplicateItemException
- if x is already present.public void remove(Node key)
key
- the item to remove.ItemNotFoundException
- if x is not found.public Node findMin()
public boolean isEmpty()