Interface SmartPriorityQueue<E>
-
- Type Parameters:
E- element class
- All Superinterfaces:
Collection<E>,Iterable<E>,SmartCollection<E>
- All Known Subinterfaces:
SmartDynamicPriorityQueue<E>,SmartGeneralPriorityQueue<E,K>
- All Known Implementing Classes:
BackedGeneralPriorityQueue,BinaryHeap
public interface SmartPriorityQueue<E> extends SmartCollection<E>
Priority queue interface. Note that this class deliberately does not specify whether the inserted elements come with their own key (i.e. implementComparableor can be compared using a comparator), or have external keys attached.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EextractMin()Retrieves and removes the element with the minimum key in the priority queue.EpeekMin()Retrieves, but does not remove the element with the minimum key in the priority queue.-
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
-
Methods inherited from interface net.automatalib.common.smartcollection.SmartCollection
addAll, addAll, choose, chooseRef, deepClear, find, get, quickClear, referencedAdd, referenceIterator, references, remove, remove, replace
-
-
-
-
Method Detail
-
peekMin
E peekMin()
Retrieves, but does not remove the element with the minimum key in the priority queue. If there are several elements with minimal key values, one of them is chosen arbitrarily.- Returns:
- an element with a minimal key.
-
extractMin
E extractMin()
Retrieves and removes the element with the minimum key in the priority queue. If there are several elements with minimal key values, one of them is chosen arbitrarily.- Returns:
- the element with the previously minimal key.
-
-