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 returns the entry created.
|
boolean |
isEmpty()
Tests whether the priority queue is empty.
|
Entry<K,V> |
min()
Returns (but does not remove) an entry with minimal key.
|
Entry<K,V> |
removeMin()
Removes and returns an entry with minimal key.
|
int |
size()
Returns the number of items in the priority queue.
|
int size()
boolean isEmpty()
Entry<K,V> insert(K key, V value) throws IllegalArgumentException
key
- the key of the new entryvalue
- the associated value of the new entryIllegalArgumentException
- if the key is unacceptable for this queueEntry<K,V> min()