E
- class representing the item stored in the priority queue, should
implement the Prioritizeble interfacepublic interface PriorityQueueADT<E extends Prioritizable>
Modifier and Type | Method and Description |
---|---|
E |
getMax()
Returns the item with the highest priority.
|
void |
insert(E item)
Adds the given item to the priority queue.
|
boolean |
isEmpty()
Returns true if this priority queue contains no items.
|
E |
removeMax()
Removes and returns the item with the highest priority.
|
int |
size()
Returns the number of items in this priority queue.
|
boolean isEmpty()
void insert(E item)
item
- the item to insert into the priority queueE removeMax()
java.util.NoSuchElementException
- if the priority queue is emptyE getMax()
java.util.NoSuchElementException
- if the priority queue is emptyint size()