maxKPriorityQueue<
K,V>(k,keyOrder,entries?):KPriorityQueue<K,V>
Defined in: packages/heap/src/priority-queue.ts:723
Create a max priority queue over a k-ary heap: same contract as
maxPriorityQueue, with up to k children per node.
Type Parameters
Section titled “Type Parameters”K
V
Parameters
Section titled “Parameters”number
Arity: children per node. Must be a safe integer >= 2.
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”KPriorityQueue<K, V>
Example
Section titled “Example”const pq = maxKPriorityQueue(4, numberOrder, [[5, 'a'], [1, 'b'], [3, 'c']])pq.peek() // 'a'Throws
Section titled “Throws”With code INVALID_ARITY when k is not
a safe integer of at least 2.
Throws
Section titled “Throws”With code DUPLICATE_VALUE when entries
carries one value twice.