class documentation

class UnsortedPriorityQueue(PriorityQueueBase):

View In Hierarchy

A min-oriented priority queue implemented with an unsorted list.

Method __init__ Create a new empty Priority Queue.
Method __len__ Return the number of items in the priority queue.
Method add Add a key-value pair.
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 _find_min Return Position of item with minimum key.
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):

Create a new empty Priority Queue.

def __len__(self):

Return the number of items in the priority queue.

def add(self, key, value):

Add a key-value pair.

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 _find_min(self):

Return Position of item with minimum key.

_data =

Undocumented