Package com.zybooks.dsaj.pq
Interface AdaptablePriorityQueue<K,V>
- Type Parameters:
K
- The key type (keys must be unique and comparable)V
- The value type stored with each entry
- All Superinterfaces:
PriorityQueue<K,
V>
- All Known Implementing Classes:
HeapAdaptablePriorityQueue
Interface for the adaptable priority queue ADT. The Entry instance
returned by the insert method can later be used to remove the
entry, or to modify that entry's key or value.
-
Method Summary
-
Method Details
-
remove
Removes the given entry from the priority queue.- Parameters:
entry
- an entry of this priority queue- Throws:
IllegalArgumentException
- if e is not a valid entry for the priority queue.
-
replaceKey
Replaces the key of an entry.- Parameters:
entry
- an entry of this priority queuekey
- the new key- Throws:
IllegalArgumentException
- if e is not a valid entry for the priority queue.
-
replaceValue
Replaces the value of an entry.- Parameters:
entry
- an entry of this priority queuevalue
- the new value- Throws:
IllegalArgumentException
- if e is not a valid entry for the priority queue.
-