We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ca3dbb commit 2fef380Copy full SHA for 2fef380
10-并查集、图相关算法介绍.md
@@ -61,6 +61,7 @@ func (set *UnionSet) FindFather(cur *Node) *Node {
61
for len(path) != 0 {
62
for i := len(path) - 1; i >= 0; i-- {
63
set.Parents[path[i]] = cur
64
+ path = path[:len(path) - 1] // 模拟栈的弹出
65
}
66
67
return cur
0 commit comments