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

Struct Heap

structure/heap/heap.go:9–12  ·  view source on GitHub ↗

Heap heap implementation using generic.

Source from the content-addressed store, hash-verified

7
8// Heap heap implementation using generic.
9type Heap[T any] struct {
10 heaps []T
11 lessFunc func(a, b T) bool
12}
13
14// New gives a new heap object.
15func New[T constraints.Ordered]() *Heap[T] {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected