MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / scc_dfs

Function scc_dfs

code/graph/scc.cpp:4–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2vector<bool> visited;
3vi order;
4void scc_dfs(const vvi &adj, int u) {
5 int v; visited[u] = true;
6 rep(i,0,size(adj[u]))
7 if (!visited[v = adj[u][i]]) scc_dfs(adj, v);
8 order.push_back(u); }
9pair<union_find, vi> scc(const vvi &adj) {
10 int n = size(adj), u, v;
11 order.clear();

Callers 1

sccFunction · 0.85

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected