I couldn't understand the syntax of the way the vector root has been initialized with size sz in the constructor - UnionFind(int sz) : root(sz)
class UnionFind {
public:
UnionFind(int sz) : root(sz) {
for (int i = 0; i < sz; i++) {
root[i] = i;
}
}
private:
vector<int> root;
};
int main() {
UnionFind uf(10);
}