Skip to content

Glossary: Data Structures and Algorithms in Go

container/heap

Also written: heap package, heap.Push, heap.Pop, heap.Init

A standard-library package that keeps a slice arranged as a heap. You supply a type with five methods, then call `heap.Push` and `heap.Pop` (O(log n)) or `heap.Init` (O(n)).

Where the book teaches it

Related terms

HeapInterfacePriority queueType assertion