#heapq
Title: heapq
The most important feature of a heap is that heap[0] is always the smallest item.
heapq.heappop()-pops off the first item and replaces it with the next smallest item (an operation that
requires O(log N) operations where N is the size of the heap)
source: Python cookbook
Title: heapq
The most important feature of a heap is that heap[0] is always the smallest item.
heapq.heappop()-pops off the first item and replaces it with the next smallest item (an operation that
requires O(log N) operations where N is the size of the heap)
source: Python cookbook