MCPcopy Create free account
hub / github.com/course-dasheng/fe-algorithm / parent

Method parent

interview/heap.js:56–58  ·  view source on GitHub ↗
(k)

Source from the content-addressed store, hash-verified

54 return k*2+1
55 }
56 parent(k){
57 return Math.floor(k/2)
58 }
59 swap(i,j){
60 [this.arr[i],this.arr[j]] = [this.arr[j],this.arr[i]]
61 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected