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

Method Graph

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected