Deque
November 14, 2020 ยท View on GitHub
Implements: IEnumerable<T>
Represents a double ended queue for which insertion and retrieval of elements close to either of the ends is very efficient.
Constructors
Deque() Initializes a new instance of Deque
Deque(int capacity) Initializes a new instance of Deque
Deque(IEnumerable<T> collection) Initializes a new instance of Deque
Properties
int Count Gets the number of elements contained in the Deque
int Capacity Gets the maximum number of elements the internal data structure can hold without resizing.
T Back Returns the first element at the rear of the Deque
T Front Returns the first element at the front of the Deque
T this[int index] Gets or sets the element at the specified position of the Deque
Methods
void PushBack(T item) Inserts a new element to the rear of the Deque
void PushFront(T item) Inserts a new element to the front of the Deque
T PopBack() Removes the element at the rear of the Deque
T PopFront() Removes the element at the front of the Deque
void Clear() Removes all elements from the Deque
bool Contains(T item) Determines whether the Deque
void CopyTo(T[] array, int arrayIndex) Copies the elements of the Deque
bool Remove(T item) Removes the first occurrence of a specific element from the Deque
int IndexOf(T item) Searches for the specified element and returns the zero-based index of the first occurrence within the entire Deque
void Insert(int index, T item) Inserts an element into the Deque
void RemoveAt(int index) Removes the element at the specified index of the Deque