MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / updateidx

Method updateidx

sort/heapsort.go:70–72  ·  view source on GitHub ↗
(i int)

Source from the content-addressed store, hash-verified

68}
69
70func (h MaxHeap) updateidx(i int) {
71 h.indices[h.slice[i].Idx()] = i
72}
73
74func (h *MaxHeap) swap(i, j int) {
75 h.slice[i], h.slice[j] = h.slice[j], h.slice[i]

Callers 3

PopMethod · 0.95
PushMethod · 0.95
swapMethod · 0.95

Calls 1

IdxMethod · 0.65

Tested by

no test coverage detected