You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
对,这里有问题,应该是:
if uf.count[proot ] == len(uf.parent)-1 {
//proot is the root of the tree, no need to merge
} else if uf.count[qroot] == len(uf.parent)-1 {
proot , qroot = qroot, proot
} else if uf.count[qroot] > uf.count[proot] {
proot , qroot = qroot, proot
}
LeetCode-Go/template/UnionFind.go
Line 104 in f0792d1
感觉这个地方应该是:
应该是 uf.count[proot]== len(uf.parent)-1
The text was updated successfully, but these errors were encountered: