MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Method main

Java/BfsTraversal.java:41–57  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

39 }
40
41 public static void main(String args[]) {
42 Scanner sc = new Scanner(System.in);
43 System.out.println("Enter number of vertices");
44 int ve = sc.nextInt();
45 BfsTraversal graph = new BfsTraversal(ve);
46 System.out.println("Enter number of edges");
47 int e = sc.nextInt();
48 for (int i = 0; i < e; i++) {
49 System.out.println("Enter starting vertex of the edge " + i);
50 int u = sc.nextInt();
51 System.out.println("Enter ending vertex of the edge " + i);
52 int v = sc.nextInt();
53 graph.insertEdge(u, v);
54 }
55 System.out.println("Breadth First Traversal for the graph is:");
56 graph.BFS(0);
57 }
58}

Callers

nothing calls this directly

Calls 2

insertEdgeMethod · 0.95
BFSMethod · 0.95

Tested by

no test coverage detected