Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/trekhleb/javascript-algorithms
/ hasParent
Method
hasParent
src/data-structures/heap/Heap.js:49–51 ·
view source on GitHub ↗
* @param {number} childIndex * @return {boolean}
(childIndex)
Source
from the content-addressed store, hash-verified
47
* @
return
{boolean}
48
*/
49
hasParent(childIndex) {
50
return
this.getParentIndex(childIndex) >= 0;
51
}
52
53
/**
54
* @param {number} parentIndex
Callers
1
heapifyUp
Method · 0.95
Calls
1
getParentIndex
Method · 0.95
Tested by
no test coverage detected