Clear a Queue : Queue : Data Structure C# Examples


C# Examples » Data Structure » Queue »

 

Clear a Queue









    
using  System;
using  System.Collections;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        Queue  a  =  new  Queue(10);
        int  x  =  0;

        a.Enqueue(x);
        x++;
        a.Enqueue(x);
        foreach  (int  y  in  a)
        {
            Console.WriteLine(y);
        }

        a.Dequeue();
        a.Clear();
    }
}
    
   
  
   



Output

0
1


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Queue