Skip to content

Commit c1efed1

Browse files
committed
rename
1 parent 7714df5 commit c1efed1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/data_structures/dsu/dsu.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
struct DSU {
44
vi p;
55
DSU(int n): p(n, -1) {}
6-
int size(int x) { return -p[go(x)]; }
7-
int go(int x) { return p[x] < 0 ? x : p[x] = go(p[x]); }
6+
int size(int x) { return -p[f(x)]; }
7+
int f(int x) { return p[x] < 0 ? x : p[x] = f(p[x]); }
88
bool join(int a, int b) {
9-
if ((a = go(a)) == (b = go(b))) return 0;
9+
if ((a = f(a)) == (b = f(b))) return 0;
1010
if (p[a] > p[b]) swap(a, b);
1111
return p[a] += p[b], p[b] = a, 1;
1212
}

0 commit comments

Comments
 (0)