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

Method Push

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

Source from the content-addressed store, hash-verified

51}
52
53func (h *MaxHeap) Push(i Comparable) {
54 h.slice = append(h.slice, i)
55 h.updateidx(h.heapSize)
56 h.heapifyUp(h.heapSize)
57 h.heapSize++
58}
59
60func (h MaxHeap) Size() int {
61 return h.heapSize

Callers 1

DijkstraMethod · 0.95

Calls 2

updateidxMethod · 0.95
heapifyUpMethod · 0.95

Tested by

no test coverage detected