Class QueueWithResizeableArray<T>
- Namespace
- AlgorithmsSW.Queue
- Assembly
- AlgorithmsSW.dll
[ExerciseReference(1, 3, 14)]
public class QueueWithResizeableArray<T> : IQueue<T>, IEnumerable<T>, IEnumerable
Type Parameters
T
- Inheritance
-
QueueWithResizeableArray<T>
- Implements
-
IQueue<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
QueueWithResizeableArray(int)
public QueueWithResizeableArray(int capacity = 4)
Parameters
capacity
int
Properties
Capacity
public int Capacity { get; }
Property Value
Count
Gets the number of items contained in the IQueue<T>.
public int Count { get; }
Property Value
IsEmpty
Gets a value indicating whether the IQueue<T> is empty.
public bool IsEmpty { get; }
Property Value
IsFull
public bool IsFull { get; }
Property Value
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
TThe 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.