Enqueue 1,2,3 then Dequeue and print.
Ready — edit the code above and click Run.
using System;
class Program
{
static void Main()
{
using System.Collections.Generic;
var q = new Queue<int>();
q.Enqueue(1); q.Enqueue(2);
Console.WriteLine(q.Dequeue());
}
}
Try solving on your own first, then reveal the official answer.
Queue is First-In-First-Out—BFS uses queues.