Generic Queue collection class in C sharp Arabic #81

 


Generic Queue collection class in C sharp Arabic #81

Suggested Videos




Generic Queue collection class

Queue is generic FIFP(First in First Out) collection class that is present in System .Collections.Generic namespace .The Queue collection class is analogous to a queue at the ATM machine to withdraw money. The order in which people queue up, will be the order in which they will be able to get out of the queue and withdraw money from the ATM. The Queue collection class operates in a similar fashion. The first item to be added (enqueued) to the queue , will be the first item to be removed (dequeued)f from the Queue.

To add items to the end of queue , use Enqueue() method.

To remove an item that is present at the beginning of the queue. Use Dequeue() method.

A foreach loop iterates thru the items in the queue, but will not remove them the queue.

To check if an item, exists in the queue , use Contains() method.

What is the difference between Dequeue() and Peek() methods?

Dequeue() method removes and returns the item at the beginning of the queue, where as Peek() returns the item at the beginning of the queue, without removing it.

Follow Us

YouTube

 If you want to download pptx : click Telegram

Facebook

Twitter

Instagram

Tik Tok


إرسال تعليق

أحدث أقدم