System.Collections by Microsoft

<PackageReference Include="System.Collections" Version="4.0.11-beta-23409" />

 Queue<T>

Represents a first-in, first-out collection of objects.

Enumerates the elements of a Queue<T>.

public int Count { get; }

Gets the number of elements contained in the Queue<T>.

public Queue()

Initializes a new instance of the Queue<T> class that is empty and has the default initial capacity.

public Queue(int capacity)

Initializes a new instance of the Queue<T> class that is empty and has the specified initial capacity.

public Queue(IEnumerable<T> collection)

Initializes a new instance of the Queue<T> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.

public void Clear()

Removes all objects from the Queue<T>.

public bool Contains(T item)

Determines whether an element is in the Queue<T>.

public void CopyTo(T[] array, int arrayIndex)

Copies the Queue<T> elements to an existing one-dimensional Array, starting at the specified array index.

public T Dequeue()

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

public void Enqueue(T item)

Adds an object to the end of the Queue<T>.

Returns an enumerator that iterates through the Queue<T>.

public T Peek()

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

public T[] ToArray()

Copies the Queue<T> elements to a new array.

public void TrimExcess()

Sets the capacity to the actual number of elements in the Queue<T>, if that number is less than 90 percent of current capacity.