Skip to content

Commit

Permalink
Use pattern matching to make BiconnectedComponents a little shorter (
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanRenison authored Apr 20, 2024
1 parent 431a6ef commit 19fb5e2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions content/graph/BiconnectedComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ vector<vector<pii>> ed;
int Time;
template<class F>
int dfs(int at, int par, F& f) {
int me = num[at] = ++Time, e, y, top = me;
for (auto pa : ed[at]) if (pa.second != par) {
tie(y, e) = pa;
int me = num[at] = ++Time, top = me;
for (auto [y, e] : ed[at]) if (e != par) {
if (num[y]) {
top = min(top, num[y]);
if (num[y] < me)
Expand Down

0 comments on commit 19fb5e2

Please sign in to comment.