|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Created by IntelliJ IDEA. User: pereira Date: Jun 18, 2005 Time: 7:46:46 PM Interface representing the basic methods for a priority queue.
Method Summary | |
boolean |
contains(QueueElement e)
Does the queue contain an element? |
void |
decreaseKey(QueueElement e,
double priority)
Lower the priority of queue element e to priorrity . |
QueueElement |
extractMin()
Remove the top element of the queue. |
void |
insert(QueueElement e)
Insert element e into the queue. |
QueueElement |
min()
Return the top element of the queue. |
int |
size()
The current size of the queue. |
Method Detail |
public void insert(QueueElement e)
e
into the queue.
e
- the element to insertpublic int size()
public QueueElement min()
public QueueElement extractMin()
public void decreaseKey(QueueElement e, double priority)
e
to priorrity
.
The element's position in the queue is adjusted as needed.
IllegalArgumentException
s are thrown if the element is not in the queue or
if the new priority value is greater than the old value.
e
- the element that has been changedpriority
- the new prioritypublic boolean contains(QueueElement e)
e
- the element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |