public interface PriorityQueue
| Modifier and Type | Method and Description |
|---|---|
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.
|
void insert(QueueElement e)
e into the queue.e - the element to insertint size()
QueueElement min()
QueueElement extractMin()
void decreaseKey(QueueElement e, double priority)
e to priorrity.
The element's position in the queue is adjusted as needed.
IllegalArgumentExceptions 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 priorityboolean contains(QueueElement e)
e - the elementCopyright © 2019 JULIE Lab, Germany. All rights reserved.