Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/course-dasheng/fe-algorithm
/ swap
Method
swap
interview/heap.js:59–61 ·
view source on GitHub ↗
(i,j)
Source
from the content-addressed store, hash-verified
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
}
62
}
63
64
let
heap =
new
Heap((a,b)=>a>b)
//大顶堆
Callers
3
shiftUp
Method · 0.95
pop
Method · 0.95
sinkDown
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected