public WeightedQuickUnionUF(int n) { count = n; id = new int[n]; sz = new int[n]; for (int i = 0; i < n; i++) { id[i] = i; sz[i] = 1; } }