Table of Contents

Class QueueWithLinkedList<T>

Namespace
AlgorithmsSW.Queue
Assembly
AlgorithmsSW.dll

Queue implementation using a linked list.

[AlgorithmReference(1, 3)]
public sealed class QueueWithLinkedList<T> : IQueue<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

The type of elements that can be inserted into the queue.

Inheritance
QueueWithLinkedList<T>
Implements
Inherited Members
Extension Methods

Properties

Count

Gets the number of items contained in the IQueue<T>.

public int Count { get; }

Property Value

int

IsEmpty

Gets a value indicating whether the IQueue<T> is empty.

public bool IsEmpty { get; }

Property Value

bool

Peek

Gets the item at the beginning of the IQueue<T> without removing it.

public T Peek { get; }

Property Value

T

Methods

Clear()

Removes all items from the IQueue<T>.

public void Clear()

Dequeue()

Removes and returns the item at the beginning of the IQueue<T>.

public T Dequeue()

Returns

T

The item at the beginning of the IQueue<T>.

Enqueue(T)

Adds an item to the end of the IQueue<T>.

public void Enqueue(T item)

Parameters

item T

The item to add to the IQueue<T>.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

An enumerator that can be used to iterate through the collection.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.