(heap: Heap<T>, node: T)
| 15 | }; |
| 16 | |
| 17 | export function push<T: Node>(heap: Heap<T>, node: T): void { |
| 18 | const index = heap.length; |
| 19 | heap.push(node); |
| 20 | siftUp(heap, node, index); |
| 21 | } |
| 22 | |
| 23 | export function peek<T: Node>(heap: Heap<T>): T | null { |
| 24 | return heap.length === 0 ? null : heap[0]; |
no test coverage detected