MCPcopy
hub / github.com/TheAlgorithms/Go / Update

Method Update

sort/heapsort.go:64–68  ·  view source on GitHub ↗
(i Comparable)

Source from the content-addressed store, hash-verified

62}
63
64func (h MaxHeap) Update(i Comparable) {
65 h.slice[h.indices[i.Idx()]] = i
66 h.heapifyUp(h.indices[i.Idx()])
67 h.heapifyDown(h.indices[i.Idx()])
68}
69
70func (h MaxHeap) updateidx(i int) {
71 h.indices[h.slice[i].Idx()] = i

Callers 1

DijkstraMethod · 0.95

Calls 3

heapifyUpMethod · 0.95
heapifyDownMethod · 0.95
IdxMethod · 0.65

Tested by

no test coverage detected