MCPcopy Create free account
hub / github.com/SR-Sunny-Raj/Hacktoberfest2021-DSA / dfs

Function dfs

17. Graph/GameTheoryInGraph.cpp:13–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11vector<int> degree;
12
13void dfs(int v) {
14 visited[v] = true;
15 for (int u : adj_rev[v]) {
16 if (!visited[u]) {
17 if (losing[v])
18 winning[u] = true;
19 else if (--degree[u] == 0)
20 losing[u] = true;
21 else
22 continue;
23 dfs(u);
24 }
25 }
26}
27struct State {
28 int P, T;
29 bool Pstep;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected