Skip to content

Glossary: Algorithms Beyond the Basics in JavaScript

Min-heap

Also written: heap, MinHeap

A collection that always hands back its smallest item first, in O(log n) time for push and pop. JavaScript has none built in, so a small `MinHeap` class can be written and used for room counting, Dijkstra's algorithm and roast scheduling.

Where the book teaches it

Related terms

Stale entryDijkstra's algorithm