Queue Concept in .Net
A collection that works on the First In First Out (FIFO) principle, i.e.,
the first item inserted is the first item removed from the collection.
Enqueue - To add element and Dequeue – To Remove element
Example:static void Main()
{
Queue queue = new Queue();
queue.Enqueue(2);
queue.Enqueue(4);
queue.Enqueue(6);
while(queue.Count != 0)
{
Console.WriteLine(queue.Dequeue());
}
}
Output
2
4
6
1 comment:
can u give the coding for stack and queue using arraylist in c#.net
Post a Comment