maxBinaryHeap<
A>(order,items?):BinaryHeap<A>
Defined in: packages/heap/src/binary-heap.ts:358
Create a max binary heap: the largest element per order is at the root,
and pop extracts in descending order.
Type Parameters
Section titled “Type Parameters”A
Parameters
Section titled “Parameters”Order<A>
Total ordering over the elements.
items?
Section titled “items?”Iterable<A, any, any>
Optional initial elements, in iteration order.
Returns
Section titled “Returns”BinaryHeap<A>
Example
Section titled “Example”const heap = maxBinaryHeap(numberOrder, [30, 1, 50, 20])heap.peek() // 50