Heaps

Jaskomal
Aug 23, 2021

Heaps are a data structure that complements binary trees, they keep track of max and min values, called max-heaps and min-heaps. The root value of heaps will be the max value or the min value and each child node will be either greater or less than its parent node, depending on the value.

Min-heap tree

Max-heap tree

--

--