Part 82 Generic queue collection class04:33

  • 0
Published on June 14, 2017

Text version of the video

Slides

Link for csharp, asp.net, ado.net, dotnet basics, mvc and sql server video tutorial playlists

Queue is a generic FIFO (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) from the Queue.

To add items to the end of the 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 from 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.

https://cafeadobro.ro/

https://www.stagebox.uk/wp-includes/depo10-bonus10/

depo 25 bonus 25

https://parfumschristianblanc.com/

https://www.barplate.com/wp-includes/js/qris/

https://hotmusic507.org/

Enjoyed this video?
"No Thanks. Please Close This Box!"