public DFS(Graph graph, int s) { this.graph = graph; int v = graph.V(); marked = new bool[v]; }
private void dfs(int v) { marked[v] = true; for (int i = 0; i < graph.V(); i++) { if (!marked[i]) { dfs(i); } } }