data_structures_free
This commit is contained in:
17
net/datastructures/PriorityQueue.java
Normal file
17
net/datastructures/PriorityQueue.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package net.datastructures;
|
||||
|
||||
//begin#fragment PriorityQueue
|
||||
/** Interface for the priority queue ADT */
|
||||
public interface PriorityQueue<K,V> {
|
||||
/** Returns the number of items in the priority queue. */
|
||||
public int size();
|
||||
/** Returns whether the priority queue is empty. */
|
||||
public boolean isEmpty();
|
||||
/** Returns but does not remove an entry with minimum key. */
|
||||
public Entry<K,V> min() throws EmptyPriorityQueueException;
|
||||
/** Inserts a key-value pair and return the entry created. */
|
||||
public Entry<K,V> insert(K key, V value) throws InvalidKeyException;
|
||||
/** Removes and returns an entry with minimum key. */
|
||||
public Entry<K,V> removeMin() throws EmptyPriorityQueueException;
|
||||
}
|
||||
//end#fragment PriorityQueue
|
||||
Reference in New Issue
Block a user