K - the type of keys maintained by this heapV - the type of values maintained by this heappublic interface DoubleEndedAddressableHeap<K,V> extends AddressableHeap<K,V>
AddressableHeap.Handle which can later
be used in order to manipulate the element, such as decreasing its key,
increasing its key, or deleting it. Storing the handle externally is the
responsibility of the user.| Modifier and Type | Interface and Description |
|---|---|
static interface |
DoubleEndedAddressableHeap.Handle<K,V>
A double-ended heap element handle.
|
| Modifier and Type | Method and Description |
|---|---|
DoubleEndedAddressableHeap.Handle<K,V> |
deleteMax()
Delete and return an element with the maximum key.
|
DoubleEndedAddressableHeap.Handle<K,V> |
deleteMin()
Delete and return an element with the minimum key.
|
DoubleEndedAddressableHeap.Handle<K,V> |
findMax()
Find an element with the maximum key.
|
DoubleEndedAddressableHeap.Handle<K,V> |
findMin()
Find an element with the minimum key.
|
DoubleEndedAddressableHeap.Handle<K,V> |
insert(K key)
Insert a new element into the heap with a null value.
|
DoubleEndedAddressableHeap.Handle<K,V> |
insert(K key,
V value)
Insert a new element into the heap.
|
clear, comparator, isEmpty, sizeDoubleEndedAddressableHeap.Handle<K,V> insert(K key, V value)
insert in interface AddressableHeap<K,V>key - the element's keyvalue - the element's valueDoubleEndedAddressableHeap.Handle<K,V> insert(K key)
insert in interface AddressableHeap<K,V>key - the element's keyDoubleEndedAddressableHeap.Handle<K,V> findMin()
findMin in interface AddressableHeap<K,V>DoubleEndedAddressableHeap.Handle<K,V> deleteMin()
AddressableHeap.Handle.getKey()
and AddressableHeap.Handle.getValue() can be used.deleteMin in interface AddressableHeap<K,V>DoubleEndedAddressableHeap.Handle<K,V> findMax()
NoSuchElementException - if the heap is emptyDoubleEndedAddressableHeap.Handle<K,V> deleteMax()
NoSuchElementException - if the heap is emptyCopyright © 2018. All rights reserved.