working implementations of MinHeap and PriorityQueue