Binary Heap in C++
- Also Known as a Priority Queue
Binary Heap Tree Properties
-
It’s a complete tree, in which all levels are completely filled except possibly the last level! If the last level isn’t full, the values must be as far left as possible
-
Is either a Min Heap or a Max Heap
How is a Binary Heap Represented?
- A Binary Heap is typically represented as an array, with the root element being at Array[0] index.
Applications of Heaps
- Heap Sort
- Priority Queue
- Graph Algorithms