public interface PCue<E>
Modifier and Type | Method and Description |
---|---|
void |
add(E e,
double priority)
Add e with priority p to the priority queue.
|
E |
peek()
Return the element of the priority queue with lowest priority, without
changing the priority queue.
|
E |
poll()
Remove and return the element of the priority queue with lowest priority.
|
int |
size()
Return the number of elements in the priority queue.
|
java.lang.String |
toString()
Return a string that represents this priority queue, in the format:
[item0:priority0, item1:priority1, ..., item(N-1):priority(N-1)]
Thus, the list is delimited by '[' and ']' and ", " (i.e.
|
void |
updatePriority(E e,
double p)
Change the priority of element e to p.
|
java.lang.String toString()
toString
in class java.lang.Object
int size()
void add(E e, double priority) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
E peek()
E poll()
void updatePriority(E e, double p)