PriorityQueue<TElement,TPriority>.DequeueEnqueue Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Removes the minimal element and then immediately adds the specified element with associated priority to the PriorityQueue<TElement,TPriority>.
public:
TElement DequeueEnqueue(TElement element, TPriority priority);
public TElement DequeueEnqueue (TElement element, TPriority priority);
member this.DequeueEnqueue : 'Element * 'Priority -> 'Element
Public Function DequeueEnqueue (element As TElement, priority As TPriority) As TElement
Parameters
- element
- TElement
The element to add to the PriorityQueue<TElement,TPriority>.
- priority
- TPriority
The priority with which to associate the new element.
Returns
The minimal element removed before performing the enqueue operation.
Exceptions
The queue is empty.
Remarks
Implements an extract-then-insert heap operation that is generally more efficient than sequencing Dequeue and Enqueue operations: in the worst case scenario only one shift-down operation is required.