MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / Graph

Method Graph

Programs/DFS.java:14–23  ·  view source on GitHub ↗
(int v)

Source from the content-addressed store, hash-verified

12 private boolean visited[]; //to keep track of the node which are visited.
13
14 Graph(int v){
15 this.v = v;
16 this.adj = new LinkedList[v];
17 this.visited = new boolean[v];
18 for(int i=0;i<this.v;i++) {
19 adj[i] = new LinkedList<Integer>();
20 this.visited[i] = false;
21 }
22
23 }
24
25
26 public void addEdge(int u,int v) { // edge from u -> v

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected