MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Swap

Method Swap

graph/prim.go:16–16  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

14func (h minEdge) Len() int { return len(h) }
15func (h minEdge) Less(i, j int) bool { return h[i].Weight < h[j].Weight }
16func (h minEdge) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
17
18func (h *minEdge) Push(x interface{}) {
19 *h = append(*h, x.(Edge))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected