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 7382941 commit fe985d2Copy full SHA for fe985d2
thinkings/union-find.md
@@ -80,6 +80,10 @@ def find(self, x):
80
81

82
83
+极限情况下,每一个路径都会被压缩,这种情况下继续查找的时间复杂度就是 $O(1)$。
84
+
85
+
86
87
### connected
88
89
直接利用上面实现好的 find 方法即可。如果两个节点的祖先相同,那么其就联通。
0 commit comments