Priority queue implementation with max-heap as the underlying data structure, iterative solution. Code in Java, JavaScript, Python.