New Maix series products MaixCAM online now, and new MaixPy,feature richer functionalities, enhanced performance, and user-friendly software, with comprehensive documentationx

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.

1. Function#

1.1. heappush#

uheapq.heappush(heap, item)

Put elements into the heap.

1.2. heappop#

uheapq.heappop(heap)

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

1.3. heapify#

uheapq.heapify(x)

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

Related Issues not found

Please login GitHub to create issue