* Inserts a new value into the heap. * @param {*} value - The value to be inserted into the heap.
(value)
| 30 | * @param {*} value - The value to be inserted into the heap. |
| 31 | */ |
| 32 | insert(value) { |
| 33 | this.heap.push(value) |
| 34 | this.#bubbleUp(this.heap.length - 1) |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Returns the number of elements in the heap. |
no test coverage detected