minBinaryHeap<
A>(order,items?):BinaryHeap<A>
Defined in: packages/heap/src/binary-heap.ts:341
Create a min binary heap: the smallest element per order is at the root,
and pop extracts in ascending 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 = minBinaryHeap(numberOrder, [30, 1, 50, 20])heap.peek() // 1