public interface PriorityQueue<K,V>
Modifier and Type | Method and Description |
---|---|
Entry<K,V> |
insert(K key,
V value)
Inserts a key-value pair and return the entry created.
|
boolean |
isEmpty()
Returns whether the priority queue is empty.
|
Entry<K,V> |
min()
Returns but does not remove an entry with minimum key.
|
Entry<K,V> |
removeMin()
Removes and returns an entry with minimum key.
|
int |
size()
Returns the number of items in the priority queue.
|
Entry<K,V> insert(K key, V value) throws InvalidKeyException
InvalidKeyException
boolean isEmpty()
Entry<K,V> min() throws EmptyPriorityQueueException
EmptyPriorityQueueException
Entry<K,V> removeMin() throws EmptyPriorityQueueException
EmptyPriorityQueueException
int size()