minPriorityQueue<
K,V>(keyOrder,entries?):BinaryPriorityQueue<K,V>
Defined in: packages/heap/src/priority-queue.ts:646
Create a min priority queue over a binary heap: the entry with the
smallest key per keyOrder is at the root, and pop extracts in
ascending key order.
Type Parameters
Section titled “Type Parameters”K
V
Parameters
Section titled “Parameters”keyOrder
Section titled “keyOrder”Order<K>
Total ordering over the keys.
entries?
Section titled “entries?”Iterable<readonly [K, V], any, any>
Optional initial [key, value] pairs, in iteration order.
Returns
Section titled “Returns”BinaryPriorityQueue<K, V>
Example
Section titled “Example”const pq = minPriorityQueue(numberOrder, [[5, 'a'], [1, 'b'], [3, 'c']])pq.peek() // 'b'pq.peekEntry() // [1, 'b']Throws
Section titled “Throws”With code DUPLICATE_VALUE when entries
carries one value twice.