Algorithms

Heap

A tree where each element is smaller (or larger) than its children, so the smallest (or largest) is always on top.

Example

In a heap of 1 million tasks, seeing the most urgent is 1 step and removing it takes about 20.

Test yourself: Heap

Heaps

In a min-heap, the smallest value is at the ___.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.