This commit is contained in:
itsvinayak
2020-05-04 11:58:44 +05:30
parent 852563a2ec
commit 622ad9e41f
7 changed files with 108 additions and 104 deletions

View File

@ -5,6 +5,7 @@
* key (the value) of node P is greater than the key of node C"
* Source: https://en.wikipedia.org/wiki/Heap_(data_structure)
*/
Array.prototype.heapify = function (index, heapSize) {
let largest = index
const leftIndex = 2 * index + 1