Implements a binary heap data structure for efficient priority queue operations.
More...
template<typename T, bool isMinHeap = true>
class Sleak::Heap< T, isMinHeap >
Implements a binary heap data structure for efficient priority queue operations.
The Heap class maintains a collection of elements with a specific ordering property (min-heap or max-heap). It is suitable for scenarios where you need to efficiently retrieve the minimum or maximum element. Use this class when you need to implement priority queues, scheduling algorithms, or heap-based sorting.
Example Use Cases:
- Implementing a priority queue for task scheduling.
- Finding the kth largest element in a data stream.
- Implementing Dijkstra's shortest path algorithm.
- Heap sort implementation.
Implementation Details:
- Uses an array-based representation to store the heap elements.
- Provides methods for inserting elements and extracting the minimum or maximum element.
- Maintains the heap property after each operation.
Definition at line 28 of file Heap.hpp.