Attributes#
- “Min heap”, where index 0 is the smallest item
APIs#
heapq.heapify(iterable) -> None: Create a heap queue in-placeheapq.heappush(heap, item) -> None: Add a new itemheapq.heappop(heap) -> T: Pop the smallest itemheapq.heappushpop(heap, item) -> T: Push then pop the smallestheapq.heapreplace(heap, item) -> T: Pop then push