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

Method main

Java/DFSTraversal.java:35–51  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

33 }
34
35 public static void main(String args[]) {
36 Scanner sc = new Scanner(System.in);
37 System.out.println("Enter number of vertices");
38 int ve = sc.nextInt();
39 DFSTraversal graph = new DFSTraversal(ve);
40 System.out.println("Enter number of edges");
41 int e = sc.nextInt();
42 for (int i = 0; i < e; i++) {
43 System.out.println("Enter starting vertex of the edge " + i);
44 int u = sc.nextInt();
45 System.out.println("Enter ending vertex of the edge " + i);
46 int v = sc.nextInt();
47 graph.insertEdge(u, v);
48 }
49 System.out.println("Depth First Traversal for the graph is:");
50 graph.DFS(0);
51 }
52}

Callers

nothing calls this directly

Calls 2

insertEdgeMethod · 0.95
DFSMethod · 0.95

Tested by

no test coverage detected