circuitpython/docs/library/uheapq.rst

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
624 B
ReStructuredText
Raw Normal View History

2014-10-31 18:21:37 -04:00
:mod:`uheapq` -- heap queue algorithm
=====================================
.. module:: uheapq
:synopsis: heap queue algorithm
|see_cpython_module| :mod:`python:heapq`.
This module implements the heap queue algorithm.
A heap queue is simply a list that has its elements stored in a certain way.
Functions
---------
.. function:: heappush(heap, item)
Push the ``item`` onto the ``heap``.
.. function:: heappop(heap)
2014-11-27 18:26:08 -05:00
Pop the first item from the ``heap``, and return it. Raises IndexError if
heap is empty.
.. function:: heapify(x)
Convert the list ``x`` into a heap. This is an in-place operation.