Refactor MinPQ and extract common methods in HeapPQBase. Implement MaxPQ class.