public interface PriorityQueue<Element extends java.lang.Comparable>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all elements from the priority queue.
|
Element |
dequeue()
Retrieves and removes the head of this queue.
|
void |
enqueue(Element element)
Adds the specified element to this priority queue.
|
boolean |
isEmpty()
Indicates whether or not the queue is empty.
|
Element |
peek()
Retrieves, but does not remove, the head of this queue.
|
int |
size()
Returns the number of elements currently in this queue.
|
void clear()
Element peek()
Element dequeue()
void enqueue(Element element)
element
- is an item to be enqueuedint size()
boolean isEmpty()