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 −

Clear

Clears the collection of all of its elements

Contains

Whether or not an object is in the collection

ToArray

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

Synchronized 

A synchronized wrapper for the collection

raja
Published on 24-Jul-2018 06:32:01
Advertisements