Implements priority queues using heaps.
A priority queue is a queue of items such that its elements are extracted in order of their priority (see http://en.wikipedia.org/wiki/Priority_queue).
The priority of the items determines how they are compared, thus this class assumes that if two objects a and b are to be put in a queue with ascending order, a < b if and only if a’s priority is higher than b’s. Dually, if they are put in a queue with descending order, a > b if and only if a’s priority is higher than b’s.
The constructor creates a new queue from a given sequence.
Parameters: |
|
---|---|
Todo : | map data items to PQE |