Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/TheAlgorithms/Go
/ swap
Method
swap
sort/heapsort.go:74–78 ·
view source on GitHub ↗
(i, j int)
Source
from the content-addressed store, hash-verified
72
}
73
74
func
(h *MaxHeap) swap(i, j int) {
75
h.slice[i], h.slice[j] = h.slice[j], h.slice[i]
76
h.updateidx(i)
77
h.updateidx(j)
78
}
79
80
func
(h MaxHeap) more(i, j int) bool {
81
return
h.slice[i].More(h.slice[j])
Callers
1
heapifyUp
Method · 0.95
Calls
1
updateidx
Method · 0.95
Tested by
no test coverage detected