|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Tree<K extends java.lang.Comparable<K>,V>
This interface describes the interface for both empty and non-empty search trees.
| Method Summary | |
|---|---|
void |
addKeysToSet(java.util.Set<K> s)
Add all keys bound in this tree to the set S |
Tree<K,V> |
delete(K key)
Delete any binding the key has in this tree. |
NonEmptyTree<K,V> |
insert(K key,
V value)
Insert/update the Tree with a new key:value pair. |
K |
max()
Return the maximum key in the subtree, or null if the subtree contains no key-value mappings |
K |
min()
Return the minmum key in the subtree, or null if the subtree contains no key-value mappings |
V |
search(K key)
Find the value that this key is bound to in this tree. |
int |
size()
Return number of keys that are bound in this tree. |
| Method Detail |
|---|
@CheckForNull V search(K key)
key - --
Key to search for
@CheckReturnValue
NonEmptyTree<K,V> insert(K key,
V value)
key - --
Keyvalue - --
Value that the key maps to
@CheckReturnValue Tree<K,V> delete(K key)
key - --
Key
@CheckForNull K max()
@CheckForNull K min()
int size()
void addKeysToSet(java.util.Set<K> s)
s - -
A set that acts as an accumulator for keys
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||