标签:return cto turn -- void style code i++ int
class UnionFound { public: vector<int> v; int cnt; UnionFound(int n) { v = vector<int>(n); for (int i = 0; i < n; i++) v[i] = i; cnt = n; } int findParent(int i) { if (v[i] == i) return i; v[i] = findParent(v[i]); return v[i]; } void Union(int p, int c) { int pp = findParent(p); int cp = findParent(c); if (pp != cp) { v[cp] = pp; cnt--; } } };
标签:return cto turn -- void style code i++ int
原文地址:https://www.cnblogs.com/JTechRoad/p/8993630.html