using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World");
Console.Write("Following is Breadth First Traversal "+
"(starting from vertex 2)");
public List<int>[] adjMat;
adjMat= new List<int>[v];
adjMat[i]=new List<int>();
public void addEdge(int s, int d)
bool[] visited=new bool[V];
Queue<int> objq=new Queue<int>();
foreach (var item in adjMat[vrt])
public void DFSUtil(int vtx, bool[] visited)
foreach (var item in adjMat[vtx])
bool[] visited=new bool[V];