Package org.jheaps
Interface DoubleEndedHeap<K>
- Type Parameters:
K
- the type of keys maintained by this heap
- All Superinterfaces:
Heap<K>
- All Known Subinterfaces:
DoubleEndedValueHeap<K,
V>
- All Known Implementing Classes:
MinMaxBinaryArrayDoubleEndedHeap
A double-ended heap.
-
Method Summary
-
Method Details
-
findMax
K findMax()Find an element with the maximum key.- Returns:
- an element with the maximum key
- Throws:
NoSuchElementException
- if the heap is empty
-
deleteMax
K deleteMax()Delete and return an element with the maximum key. If multiple such elements exists, only one of them will be deleted.- Returns:
- the deleted element with the maximum key
- Throws:
NoSuchElementException
- if the heap is empty
-