MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / dfs

Method dfs

Data Structures/Reachability Tree.cpp:14–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 return par[x] = find(par[x]);
13 }
14 void dfs(int u) {
15 st[u] = T + 1;
16 for (int v : g[u]) {
17 sp[0][v] = u;
18 dfs(v);
19 }
20 if (st[u] == T + 1) {
21 rid[T + 1] = u; //real id of this node
22 T++;
23 }
24 en[u] = T;
25 }
26 void build(vector<array<int, 3>> e) { //{w, u, v}
27 n = e.size() + 1;
28 sort(e.begin(), e.end());

Callers

nothing calls this directly

Calls 1

dfsFunction · 0.70

Tested by

no test coverage detected