Module ucSearch :: Class PQ
[frames] | no frames]

Class PQ

Slow implementation of a priority queue that just finds the minimum element for each extraction.

Instance Methods
 
__init__(self)
Create a new empty priority queue.
 
push(self, item, cost)
Push an item onto the priority queue.
 
pop(self)
Returns and removes the least cost item.
 
isEmpty(self)
Returns True if the PQ is empty and False otherwise.
 
__str__(self)
Method Details

push(self, item, cost)

 

Push an item onto the priority queue. Assumes items are instances with an attribute cost.

pop(self)

 

Returns and removes the least cost item. Assumes items are instances with an attribute cost.