K - the type of keys maintained by this heapV - the type of values maintained by this heappublic static interface AddressableHeap.Handle<K,V>
| Modifier and Type | Method and Description |
|---|---|
void |
decreaseKey(K newKey)
Decrease the key of the element.
|
void |
delete()
Delete the element from the heap that it belongs.
|
K |
getKey()
Return the key of the element.
|
V |
getValue()
Return the value of the element.
|
void |
setValue(V value)
Set the value of the element.
|
K getKey()
V getValue()
void setValue(V value)
value - the new valuevoid decreaseKey(K newKey)
newKey - the new keyIllegalArgumentException - if the new key is larger than the old key according to
the comparator used when constructing the heap or the
natural ordering of the elements if no comparator was
usedvoid delete()
IllegalArgumentException - in case this function is called twice on the same element
or the element has already been deleted using
AddressableHeap.deleteMin().Copyright © 2018. All rights reserved.