Package org.jheaps
Interface DoubleEndedValueHeap<K,V>
-
- Type Parameters:
K
- the type of keys maintained by this heapV
- the type of values maintained by this heap
- All Superinterfaces:
DoubleEndedHeap<K>
,Heap<K>
public interface DoubleEndedValueHeap<K,V> extends DoubleEndedHeap<K>
A double-ended heap with values.- Author:
- Dimitrios Michail
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description V
findMaxValue()
Find the value of an element with the maximum key.V
findMinValue()
Find the value of an element with the minimum key.void
insert(K key, V value)
Insert an element into the heap.-
Methods inherited from interface org.jheaps.DoubleEndedHeap
deleteMax, findMax
-
-
-
-
Method Detail
-
insert
void insert(K key, V value)
Insert an element into the heap.- Parameters:
key
- the key to insertvalue
- the value to insert
-
findMinValue
V findMinValue()
Find the value of an element with the minimum key.- Returns:
- the value of an element with the minimum key
- Throws:
NoSuchElementException
- if the heap is empty
-
findMaxValue
V findMaxValue()
Find the value of an element with the maximum key.- Returns:
- the value of an element with the maximum key
- Throws:
NoSuchElementException
- if the heap is empty
-
-