Skip to content

Glossary: Algorithms Beyond the Basics in Go

container/heap

Also written: heap.Interface, heap.Push, heap.Pop

Go's standard heap package. You give it a type with five methods (`Len`, `Less`, `Swap`, `Push`, `Pop`) and call `heap.Push` and `heap.Pop` to keep the smallest item first.

Where the book teaches it

Related terms

Min-heapPointer receiver