PriorityQueueIntDouble

A specialized min-priority queue that stores (int Element, double Priority) pairs, always ordering by the smallest Priority first.

Constructors

PriorityQueueIntDouble

#
Initializes a new instance of the specialized priority queue.
public PriorityQueueIntDouble()

Properties

Count

#
Gets the current number of elements contained in the queue.
public int Count { get; }

Methods

Enqueue

#
Adds the specified element with associated priority to the queue.
public void Enqueue(
element,
priority
)

RemoveElements

#
Remove all the given elements in the queue. This is a relatively expensive method, best avoid calling it too often.
public void RemoveElements(
elementsToRemove
)

TryDequeue

#
Try and dequeue the element with the highest priority.
public bool TryDequeue(
out int
element,
out double
priority
)

TryPeek

#
Try and peek at the element with the highest priority.
public bool TryPeek(
out int
element,
out double
priority
)