K
- key typeV
- value typepublic final class MinHeap<K,V> extends Object
Constructor and Description |
---|
MinHeap(Comparator<K> cmp)
Constructs a heap with the given initial capacity and order.
|
MinHeap(int cap,
Comparator<K> cmp)
Constructs a heap with the given initial capacity and order.
|
public MinHeap(Comparator<K> cmp)
cmp
- comparatorpublic MinHeap(int cap, Comparator<K> cmp)
cap
- initial capacitycmp
- comparatorpublic void insert(K key, V value)
key
- keyvalue
- valuepublic V removeMin()
public int size()
public boolean isEmpty()
true
if heap is empty, false
otherwiseCopyright © 2005–2015 BaseX Team. All rights reserved.