micropython/docs/library/uheapq.rst
Damien George 88d3054ac0 docs: Import documentation from source-code inline comments.
The inline docs (prefixed with /// in .c files) have been converted to
RST format and put in the docs subdirectory.
2014-10-31 01:37:19 +00:00

26 lines
583 B
ReStructuredText

:mod:`uheapq` --- heap queue algorithm
======================================
.. module:: uheapq
:synopsis: heap queue algorithm
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)
Pop the first item froh 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.