* Swaps elements at two specified indices in the heap. * @param {number} index1 - The index of the first element to be swapped. * @param {number} index2 - The index of the second element to be swapped. * @private
(index1, index2)
| 125 | * @private |
| 126 | */ |
| 127 | #swap(index1, index2) { |
| 128 | ;[this.heap[index1], this.heap[index2]] = [ |
| 129 | this.heap[index2], |
| 130 | this.heap[index1] |
| 131 | ] |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | /** |