Priority Queues
By default, the heap
implementation in Python creates a min-heap. This means heappop
returns the smallest element.
Source: http://www.geeksforgeeks.org/heap-queue-or-heapq-in-python/
Note: To create a max-heap, we can invert the values (e.g. 5 becomes -5) before placing in the heap.