Skip to content
On this page

BinaryHeap<T>.clear

Clears BinaryHeap<T>.

Example

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

heap.clear();
heap.isEmpty // => true

Remarks

This method is an O(1) operation.