What is a binary heap?

Dijkstra Algorithm Questions



80 Short 62 Medium 80 Long Answer Questions Question Index

What is a binary heap?

A binary heap is a complete binary tree that satisfies the heap property. In a binary heap, for every node, the value of that node is greater than or equal to the values of its children (in a max heap) or less than or equal to the values of its children (in a min heap). The binary heap is commonly used in the implementation of priority queues and is efficient for operations such as insertion, deletion, and finding the minimum or maximum element.