A Deque Class in C#

CsharpServer Side ProgrammingProgramming

The Deque class uses a doubly-linked list to implement its collection of elements.  The doubly-linked lists should have two nodes i.e. front and back nodes. This helps in adding elements on the front and back of the Deque.

With the Deque class, you have the ability to add and remove elements from both the sides. This is why Deque is said to be a double-ended queue.

The Deque class has the following methods in the Queue class −


Clears the collection of all of its elements


Whether or not an object is in the collection


Use the ToArray() method to copy all of the elements in the collection to an array.


A synchronized wrapper for the collection

Updated on 19-Jun-2020 07:35:29