Skip to content

Heap

Heap are like tree data structures that satisfies the heap property. It means it's easier to do operations on the lowest/highest values.

There is 2 types of heaps:

  • In a max-heap, the root node has the maximum value. The lowest node has the lowest values.
  • In a min-heap, the root node has the minimum value. The lowest node has the highest values.

Variants

There is many variants on the data structure implementation of heaps. You'll find some of them below, but don't hesitate to have a look at the [complete list](complete list.

Binary heap

A binary heap is structured like a binary tree: each item within the tree has at most two children.

Other heaps

Resources