dfs, disjoint set