Module org.cicirello.core
Package org.cicirello.ds
Interface MergeablePriorityQueueDouble<E,T extends MergeablePriorityQueueDouble<E,T>>
- Type Parameters:
E
- The type of object contained in the PriorityQueueDouble.T
- The type of MergeablePriorityQueueDouble supported by the merge
- All Superinterfaces:
Collection<PriorityQueueNode.Double<E>>
,Iterable<PriorityQueueNode.Double<E>>
,PriorityQueueDouble<E>
,Queue<PriorityQueueNode.Double<E>>
- All Known Implementing Classes:
BinaryHeapDouble
,FibonacciHeapDouble
,SimpleBinaryHeapDouble
,SimpleFibonacciHeapDouble
public interface MergeablePriorityQueueDouble<E,T extends MergeablePriorityQueueDouble<E,T>>
extends PriorityQueueDouble<E>
A MergeablePriorityQueueDouble is a PriorityQueueDouble that includes a merge method.
-
Method Summary
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
Methods inherited from interface org.cicirello.ds.PriorityQueueDouble
add, add, addAll, change, clear, contains, containsAll, demote, element, isEmpty, iterator, offer, offer, peek, peekElement, peekPriority, peekPriority, poll, pollElement, pollThenAdd, pollThenAdd, promote, remove, remove, removeAll, removeElement, retainAll, size, toArray, toArray
-
Method Details
-
merge
Merges another priority queue into this one, adding all of its (element, priority) pairs. This is a destructive operation with no guarantees to the state of the other priority queue upon completion. Additionally, some implementations of this method may assume thatother
andthis
do not share any elements, and the priority queue may become unstable if they do. The priority order of both priority queues must be the same (e.g., both minheaps or both maxheaps).- Parameters:
other
- The priority queue that you want to merge intothis
. Implementations need not make any guarantees as to the state ofother
upon completion.- Returns:
- true if and only if this priority queue changed as a result of the merge
-