Clear a Queue : Queue « Data Structure « C# / CSharp Tutorial






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();
  }
}
0
1








11.38.Queue
11.38.1.Enqueue and dequeue
11.38.2.Clear a Queue
11.38.3.Peek a queue
11.38.4.Creating a list from a queue
11.38.5.Dequeue and Peek
11.38.6.Queue<(Of <(T>)>) generic class, including the ToArray method.
11.38.7.Queue<(Of <(T>)>) generic class, the Dequeue method.