class documentation

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_min Remove and return (k,v) tuple with minimum key.
Method _downheap Undocumented
Method _has_left Undocumented
Method _has_right 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_empty Return True if the priority queue is empty.
Class _Item Lightweight composite to store priority queue items.
def __init__(self, contents=()):

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.

def __len__(self):

Return the number of items in the priority queue.

def add(self, key, value):
def min(self):

Return but do not remove (k,v) tuple with minimum key.

Raise Empty exception if empty.

def remove_min(self):

Remove and return (k,v) tuple with minimum key.

Raise Empty exception if empty.

def _downheap(self, j):

Undocumented

def _has_left(self, j):

Undocumented

def _has_right(self, j):

Undocumented

def _heapify(self):

Undocumented

def _left(self, j):

Undocumented

def _parent(self, j):

Undocumented

def _right(self, j):

Undocumented

def _swap(self, i, j):

Swap the items at indices i and j of array.

def _upheap(self, j):

Undocumented

_data =

Undocumented