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).
Glossary: Data Structures and Algorithms in Go
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).