PriorityQueueIntDouble

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

Constructors

PriorityQueueIntDouble

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

Properties

Count

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

Methods

Enqueue

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

RemoveElements

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

TryDequeue

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

TryPeek

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