Appearance
Inserts a new value into the BinaryHeap
valueT: The value that you want to insert into the BinaryHeap
T
const heap = new BinaryHeap<number>([10, 15, 20]); heap.push(40) heap.peek() => // 40
This method is an O(log n) operation.