Skip to content

Glossary: Data Structures and Algorithms in Java

heap

Also written: min-heap, heaps

A binary tree with every level full except maybe the last, stored in an array, where each parent is no bigger than its children. The smallest item is at index 0, and add and remove take O(log n).

Where the book teaches it

Related terms

PriorityQueuemax-heappriority queue