diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2023-03-01 11:36:26 +0100 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2023-03-01 11:36:26 +0100 |
| commit | 12afe719ce268bb10aa93a910079a44eb08999b8 (patch) | |
| tree | 0937a117287eebe3942e0506d27143eff4980d09 /graph/cycleCounting.cpp | |
| parent | ad8456f7c5d44d3c647b3a368050a5d2f39ae3c3 (diff) | |
removed trailing whitespaces and use more structured bindings
Diffstat (limited to 'graph/cycleCounting.cpp')
| -rw-r--r-- | graph/cycleCounting.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/graph/cycleCounting.cpp b/graph/cycleCounting.cpp index c3fe457..bf32874 100644 --- a/graph/cycleCounting.cpp +++ b/graph/cycleCounting.cpp @@ -29,11 +29,11 @@ struct cylces { } else { seen[c] = true; paths[c] = cur; - for (auto e : adj[c]) { - if (e.first == p) continue; - cur[e.second].flip(); - findBase(e.first, c, cur); - cur[e.second].flip(); + for (auto [to, id] : adj[c]) { + if (to == p) continue; + cur[id].flip(); + findBase(to, c, cur); + cur[id].flip(); }}} //cycle must be constrcuted from base @@ -43,7 +43,7 @@ struct cylces { for (int i = 0; i < sz(edges); i++) { if (cur[i]) { cur[i] = false; - if (findSet(edges[i].first) == + if (findSet(edges[i].first) == findSet(edges[i].second)) break; unionSets(edges[i].first, edges[i].second); }} |
