Skip to content

Glossary: Data Structures and Algorithms in Go

Heap

Also written: heaps, min-heap

A binary tree stored in a slice where every parent is no bigger than its children (a min-heap), so the smallest item is always at index 0. Push and pop are O(log n).

Where the book teaches it

Related terms

Priority queueMax-heapcontainer/heapBinary tree