using System.Collections.Generic;
_adj = new LinkedList<int>[V];
for(int i = 0; i < _adj.Length; i++)
_adj[i] = new LinkedList<int>();
public void AddEdge(int v, int w)
bool[] visited = new bool[_V];
for(int i = 0; i < _V; i++)
LinkedList<int> queue = new LinkedList<int>();
LinkedList<int> list = _adj[s];
foreach (var val in list)
static void Main(string[] args)
Console.Write("Following is Breadth First " +
"Traversal(starting from " +