uheapq.rst 624 B

123456789101112131415161718192021222324252627
  1. :mod:`uheapq` -- heap queue algorithm
  2. =====================================
  3. .. module:: uheapq
  4. :synopsis: heap queue algorithm
  5. |see_cpython_module| :mod:`python:heapq`.
  6. This module implements the heap queue algorithm.
  7. A heap queue is simply a list that has its elements stored in a certain way.
  8. Functions
  9. ---------
  10. .. function:: heappush(heap, item)
  11. Push the ``item`` onto the ``heap``.
  12. .. function:: heappop(heap)
  13. Pop the first item from the ``heap``, and return it. Raises IndexError if
  14. heap is empty.
  15. .. function:: heapify(x)
  16. Convert the list ``x`` into a heap. This is an in-place operation.