Glossary: Algorithms Beyond the Basics
heapq
Also written: heappush, heappop
Python's standard-library module for heaps. `heappush` adds an item and `heappop` removes the smallest in O(log n).
Glossary: Algorithms Beyond the Basics
Also written: heappush, heappop
Python's standard-library module for heaps. `heappush` adds an item and `heappop` removes the smallest in O(log n).