Binary heap


A binary heap is a heap data structure created using a binary tree. It can be seen as a binary tree with two additional constraints:
Heaps with a mathematical "greater than or equal to" (≥) comparison predicate are called max-heaps; those with a mathematical "less than or equal to" (≤) comparison predicate are called min-heaps. Min-heaps are often used to implement priority queues.