uheapq-heap queue algorithm

This module implements a subset of the corresponding CPython module, as described below.For more information, please refer to the original CPython documentation: heapq.

This module implements the heap queue algorithm.

A heap queue is just a list that stores its elements in some way.

Function

heappush

uheapq.heappush(heap, item)

Put elements into the heap.

heappop

uheapq.heappop(heap)

Pop the first element in the heap and return it.If the heap is empty, an IndexError is raised.

heapify

uheapq.heapify(x)

Convert the list x to a heap.This is an in-place (division exchange sort) operation.