Update 图论并查集理论基础.md

修正语病
This commit is contained in:
sss1h 2024-02-27 21:58:01 +08:00 committed by GitHub
parent 2da3afe8a9
commit e361eddedd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -396,7 +396,7 @@ void join(int u, int v) {
if (rank[u] <= rank[v]) father[u] = v; // rank小的树合入到rank大的树
else father[v] = u;
if (rank[u] == rank[v] && u != v) rank[v]++; // 如果两棵树高度相同则v的高度+1因为上面 if (rank[u] <= rank[v]) father[u] = v; 注意是 <=
if (rank[u] == rank[v] && u != v) rank[v]++; // 如果两棵树高度相同则v的高度+1因为上面 if (rank[u] <= rank[v]) father[u] = v; 注意是 <=
}
```