MCPcopy Index your code
hub / github.com/Tiwarishashwat/InterviewCodes / dfs

Method dfs

KosarajuAlgo.java:3–11  ·  view source on GitHub ↗
(int node, boolean []vis, ArrayList<ArrayList<Integer>> adj, Stack<Integer> st)

Source from the content-addressed store, hash-verified

1class Solution
2{
3 private void dfs(int node, boolean []vis, ArrayList<ArrayList<Integer>> adj, Stack<Integer> st) {
4 vis[node] = true;
5 for (Integer it : adj.get(node)) {
6 if (!vis[it]) {
7 dfs(it, vis, adj, st);
8 }
9 }
10 st.push(node);
11 }
12 private void dfsCount(int node, boolean[] vis, ArrayList<ArrayList<Integer>> adjT) {
13 vis[node] = true;
14 for (Integer it : adjT.get(node)) {

Callers 1

kosarajuMethod · 0.95

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected