Heap data structure (Min Heap implementation)
A heap is a specialized tree-based data structure that satisfies the heap property:
In a min heap, for any given node I, the value of I is less than or equal to the values of its children.
Note: This class shares similar implementation with PriorityQueue. The separation is intentional
to provide distinct abstractions - Heap focuses on the data structure itself, while PriorityQueue
provides a queue-like interface.
Heap data structure (Min Heap implementation) A heap is a specialized tree-based data structure that satisfies the heap property: In a min heap, for any given node I, the value of I is less than or equal to the values of its children.
Note: This class shares similar implementation with PriorityQueue. The separation is intentional to provide distinct abstractions - Heap focuses on the data structure itself, while PriorityQueue provides a queue-like interface.
Example