We first define a generic MinHeap class with the following operations:
- size(): Returns the number of elements in the heap.
- peek(): Returns the minimum (root) without removing it.
- push(value): Inserts a value, keeping the heap structure.
- pop(): Removes and returns the minimum (root).
- heapifyUp() and heapifyDown(): Internal methods to maintain heap order.