mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-21 03:30:55 +08:00
sorts/
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user