A Queue is used to represent a first-in, first out(FIFO) collection of objects. It is used when you need first-in, first-out access of items. It… Read More
Tag Archives: CSharp-Collections-Queue
Queue.SyncRoot Property is used to get an object which can be used to synchronize access to the Queue. Queue represents a first-in, first out collection… Read More
Queue() Constructor is used to initializes a new instance of the Queue class which will be empty, and will have the default initial capacity, and… Read More
This method is used to create a shallow copy of the Queue. It just creates a copy of the Queue. The copy will have a… Read More
Equals(Object) Method which is inherited from the Object class is used to check if a specified Queue class object is equal to another Queue class… Read More
This method returns an enumerator that iterates through the Queue. And it comes under the System.Collections namespace. Syntax: public virtual System.Collections.IEnumerator GetEnumerator (); Below programs… Read More
This method is used to copy the Queue elements to an existing one-dimensional Array, starting at the specified array index. The elements are copied to… Read More
This property is used get a value which indicates whether access to the Queue is synchronized (thread safe) or not. Syntax: public virtual bool IsSynchronized… Read More
This property is used to get the number of elements contained in the Queue. Retrieving the value of this property is an O(1) operation and… Read More
The Dequeue() method is used to returns the object at the beginning of the Queue. This method is similar to the Peek() Method. The only… Read More
This method is used to add an object to the end of the Queue. This comes under the System.Collections namespace. The value can null and… Read More
This method is used to copy the Queue elements to a new array. The Queue is not modified and the order of the elements in… Read More
This method is used to return a new Queue that wraps the original queue and is thread-safe. The wrapper returned by this method locks the… Read More
This method returns the object at the beginning of the Queue without removing it. This method is similar to the Dequeue method, but Peek does… Read More
This method is used to remove the objects from the Queue. This method is an O(n) operation, where n is the total count of elements.… Read More