public interface AvlTreeMap<K,V>
Modifier and Type | Method and Description |
---|---|
LinkedAvlMapNode<K,V> |
find(K key)
Find a LinkedAvlMapNode with the given key value in the tree.
|
LinkedAvlMapNode<K,V> |
find(K key,
V value)
Find a LinkedAvlMapNode with the given key and value in the tree.
|
LinkedAvlMapNode<K,V> |
findGreater(K key)
Finds a LinkedAvlMapNode whose key is higher than the given key.
|
LinkedAvlMapNode<K,V> |
findGreaterOrEqual(K key)
Finds a LinkedAvlMapNode whose key is higher than the given key.
|
LinkedAvlMapNode<K,V> |
findLess(K key)
Finds a LinkedAvlMapNode whose key is lower than the given key.
|
LinkedAvlMapNode<K,V> |
findLessOrEqual(K key)
Finds a LinkedAvlMapNode whose key is lower than the given key.
|
LinkedAvlMapNode<K,V> |
getFirst() |
Comparator<K> |
getKeyComparator() |
List<K> |
getKeys() |
LinkedAvlMapNode<K,V> |
getLast() |
LinkedAvlMapNode<K,V> |
getRoot() |
int |
getSize()
returns the number of nodes present in this tree.
|
Comparator<V> |
getValueComparator() |
V |
insert(K key,
V value)
Inserts a LinkedAvlMapNode with the given key and value.
|
boolean |
isDupsAllowed()
tells if the duplicate keys are supported or not.
|
boolean |
isEmpty()
Tests if the tree is logically empty.
|
void |
printTree()
Prints the contents of AVL tree in pretty format
|
SingletonOrOrderedSet<V> |
remove(K key)
Removes a node associated with the given key
The entire node will be removed irrespective of whether duplicate keys
are enabled or not
|
V |
remove(K key,
V value)
Removes the LinkedAvlMapNode present in the tree with the given key and value
|
Comparator<K> getKeyComparator()
Comparator<V> getValueComparator()
V insert(K key, V value)
key
- the item to be insertedvalue
- the value associated with the keyV remove(K key, V value)
key
- the key of the node to be removedvalue
- the value of the nodeIllegalArgumentException
- if key or value is nullSingletonOrOrderedSet<V> remove(K key)
key
- the key of the node to be removedIllegalArgumentException
- if key is nullboolean isEmpty()
int getSize()
LinkedAvlMapNode<K,V> getRoot()
void printTree()
LinkedAvlMapNode<K,V> getFirst()
LinkedAvlMapNode<K,V> getLast()
LinkedAvlMapNode<K,V> findGreater(K key)
key
- the keyLinkedAvlMapNode<K,V> findGreaterOrEqual(K key)
key
- the keyLinkedAvlMapNode<K,V> findLess(K key)
key
- the keyLinkedAvlMapNode<K,V> findLessOrEqual(K key)
key
- the keyLinkedAvlMapNode<K,V> find(K key)
key
- the key to findLinkedAvlMapNode<K,V> find(K key, V value)
key
- the key of the nodevalue
- the value of the nodeboolean isDupsAllowed()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.