Table of Contents

Class QueueWithLinkedListAndNodePool<T>

Namespace
AlgorithmsSW.Queue
Assembly
AlgorithmsSW.dll

Queue implementation using a linked list with a node pool.

public class QueueWithLinkedListAndNodePool<T> : IQueue<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

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

Inheritance
QueueWithLinkedListAndNodePool<T>
Implements
Inherited Members
Extension Methods

Constructors

QueueWithLinkedListAndNodePool(int)

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

public QueueWithLinkedListAndNodePool(int capacity)

Parameters

capacity int

The capacity of this queue.

Properties

Count

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

public int Count { get; }

Property Value

int

Id

Gets the Id for this instance.

public int Id { get; }

Property Value

int

Remarks

Ids are unique for among instances that share the static IdGenerator.

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.