public interface PriorityQueueInterface<E>
Modifier and Type | Method and Description |
---|---|
double |
getPriority()
Gets the priority of the highest-priority element of the queue.
|
boolean |
hasNext()
Returns true if the priority queue is non-empty
|
boolean |
isEmpty()
True if the queue is empty (size == 0).
|
E |
next()
Returns the element in the queue with highest priority, and pops it from
the queue.
|
E |
peek()
Returns the highest-priority element in the queue, but does not pop it.
|
void |
put(E key,
double priority)
Adds a key to the queue with the given priority.
|
void |
remove()
Not supported -- next() already removes the head of the queue.
|
int |
size()
Number of elements in the queue.
|
boolean hasNext()
E next()
void remove()
E peek()
double getPriority()
int size()
boolean isEmpty()
void put(E key, double priority)
key
- priority
-