uheapq
– Heap Queue Algorithm
This module implements the corresponding CPython A subset of modules, as described below. Refers to CPython document for details: heapq
This T module implements the heap queue algorithm.
A heap queue is a way to store a list of its elements.
Function
-
uheapq.
heappush
(heap, item)
Push the item
onto the heap
.
-
uheapq.
heappop
(heap)
Pop the first item from the heap
, and return it. Raises IndexError if
heap is empty.
-
uheapq.
heapify
(x)
Convert the list x
into a heap. This is an in-place operation.