<PackageReference Include="ReactiveUI.Primitives.Core" Version="8.4.0" />

ReactiveUI.Primitives.Core.PriorityQueue<T>

public sealed class PriorityQueue<T> where T : IComparable<T>
Binary heap priority queue that preserves insertion order for equal-priority items.
public int Count { get; }

Gets the number of queued items.

public PriorityQueue()

Initializes a new instance of the PriorityQueue<T> class.

public PriorityQueue(int capacity)

Initializes a new instance of the PriorityQueue<T> class.

public T Dequeue()

Removes and returns the highest-priority item.

public T[] DequeueAll()

Removes and returns all queued items in priority order.

public int DequeueRange(T[] destination)

Dequeues items into a caller-provided buffer.

public T[] DequeueSome(int count)

Removes up to count queued items in priority order.

public void Enqueue(T item)

Adds an item to the queue.

public void EnqueueRange(T[] items)

Adds multiple items to the queue.

public T Peek()

Returns the highest-priority item without removing it.

public bool Remove(T item)

Removes a matching item from the queue.

public bool TryDequeue(out T item)

Attempts to remove and return the highest-priority item.

public bool TryPeek(out T item)

Attempts to return the highest-priority item without removing it.

public bool VerifyHeapProperty()

Verifies that the internal heap property is currently valid.