Table of Contents

Class PriorityQueue<T>

Namespace
Stride.Core.Collections
Assembly
Stride.Core.dll

Represents a sorted queue, with logarithmic time insertion and deletion.

public class PriorityQueue<T>

Type Parameters

T

The type of the elements in the queue.

Inheritance
PriorityQueue<T>

Constructors

PriorityQueue()

public PriorityQueue()

PriorityQueue(IComparer<T>)

public PriorityQueue(IComparer<T> comparer)

Parameters

comparer IComparer<T>

Properties

Count

public int Count { get; }

Property Value

int

Empty

public bool Empty { get; }

Property Value

bool

Methods

Clear()

public void Clear()

Dequeue()

Removes and returns the object at the beginning of the PriorityQueue<T>.

public T Dequeue()

Returns

T

The object at the beginning of the PriorityQueue<T>.

Enqueue(T)

Adds an object to the PriorityQueue<T> and sorts underlying container.

public void Enqueue(T item)

Parameters

item T

The object to add to the queue.

Peek()

Returns the object at the beginning of the PriorityQueue<T>, without removing it.

public T Peek()

Returns

T

The object at the beginning of the PriorityQueue<T>.

Remove(T)

public void Remove(T item)

Parameters

item T