Skip to content

Glossary: Data Structures and Algorithms in Python

Heap

Also written: heaps, min-heap

A binary tree with full levels (the last filling from the left), stored in a plain list. In a min-heap every parent is no bigger than its children, so the smallest item is always at index 0.

Where the book teaches it

Related terms

Priority queueheapqMax-heapBinary tree