Skip to content
On this page

BinaryHeap<T>.peek

Returns the root node in the BinaryHeap

Example

typescript
const heap = new BinaryHeap<number>([10, 15, 20]);

heap.peek() // => 20

Remarks

This method is an O(1) operation.