MCPcopy Index your code
hub / github.com/trekhleb/javascript-algorithms / parent

Method parent

src/data-structures/heap/Heap.js:89–91  ·  view source on GitHub ↗

* @param {number} childIndex * @return {*}

(childIndex)

Source from the content-addressed store, hash-verified

87 * @return {*}
88 */
89 parent(childIndex) {
90 return this.heapContainer[this.getParentIndex(childIndex)];
91 }
92
93 /**
94 * @param {number} indexOne

Callers 2

removeMethod · 0.95
heapifyUpMethod · 0.95

Calls 1

getParentIndexMethod · 0.95

Tested by

no test coverage detected