Last active
February 14, 2021 22:51
-
-
Save phc15/0d7eba7994e8186f6610a6f1d0c20511 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void DFSRecursive(Graph g, int s, boolean[] visited) { | |
System.out.println("Visited vertex: " + s); | |
visited[s] = true; | |
for (int n : g.adj.get(s)) { | |
if (visited[n] == false) { | |
// visited[n] = true; | |
DFSRecursive(g, n, visited); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment