DEV Community

Cover image for Data Structures #2: Binary Heap
Thodoris Kouleris
Thodoris Kouleris

Posted on

Data Structures #2: Binary Heap

A Binary Heap is a kind of binary tree that is a complete binary tree. A complete binary tree is the binary tree that all levels are fully filled withe exception of the last.

A Binary Heap can be a Min Heap or a Max Heap. For the Min Heap the root of the tree keeps the minimum value and for the Max Heap the root keeps the maximum value. And that is the strong part of the binary heap. The ability to get the min/max value of a set of numbers in O(1).

read more

Top comments (0)