Home  >  Article  >  Backend Development  >  Deque class in C#

Deque class in C#

王林
王林forward
2023-08-27 20:01:05743browse

C# 中的 Deque 类

#The Deque class uses a doubly linked list to implement its collection of elements. A doubly linked list should have two nodes, the front node and the back node. This helps add elements to the front and back of the Deque.

Using the Deque class you can add and remove elements from both sides. That's why Deque is called double-ended queue.

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

Clear

Clear all elements in the collection

Contains

In the collection Is there an object

ToArray

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

Synchronization

Synchronization wrapper for A collection

The above is the detailed content of Deque class in C#. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete