class documentation
class HeapPriorityQueue(PriorityQueueBase):
Known subclasses: dsap.pq.adaptable_heap_priority_queue.AdaptableHeapPriorityQueue
A min-oriented priority queue implemented with a binary heap.
Method | __init__ |
Create a new priority queue. |
Method | __len__ |
Return the number of items in the priority queue. |
Method | add |
Add a key-value pair to the priority queue. |
Method | min |
Return but do not remove (k,v) tuple with minimum key. |
Method | remove |
Remove and return (k,v) tuple with minimum key. |
Method | _downheap |
Undocumented |
Method | _has |
Undocumented |
Method | _has |
Undocumented |
Method | _heapify |
Undocumented |
Method | _left |
Undocumented |
Method | _parent |
Undocumented |
Method | _right |
Undocumented |
Method | _swap |
Swap the items at indices i and j of array. |
Method | _upheap |
Undocumented |
Instance Variable | _data |
Undocumented |
Inherited from PriorityQueueBase
:
Method | is |
Return True if the priority queue is empty. |
Class | _ |
Lightweight composite to store priority queue items. |
Create a new priority queue.
By default, queue will be empty. If contents is given, it should be as an iterable sequence of (k,v) tuples specifying the initial contents.