The dequeue method is used to remove an element from the queue.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestApplication
{
class Program
{
static void Main(string[] args)
{
Queue qt = new Queue();
qt.Enqueue(1);
qt.Enqueue(2);
qt.Enqueue(3);
foreach (Object obj in qt)
{
Console.WriteLine(obj);
}
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("The number of elements in the Queue " + qt.Count);
Console.WriteLine("Does the Queue contain " + qt.Contains(3));
Console.ReadKey();
}
}
}
The dequeue method is used to remove an element from the queue.
need an explanation for this answer? contact us directly to get an explanation for this answer