diff --git a/notes/算法.md b/notes/算法.md index a0995ebe..41b62b2b 100644 --- a/notes/算法.md +++ b/notes/算法.md @@ -377,7 +377,7 @@ public void union(int p, int q) { 但是 find 操作开销很大,因为同一个连通分量的节点 id 值不同,id 值只是用来指向另一个节点。因此需要一直向上查找操作,直到找到最上层的节点。 -

+

```java public int find(int p) { diff --git a/pics/61f8292b-eca0-4f46-a1be-f18d1e5c6fa9.png b/pics/61f8292b-eca0-4f46-a1be-f18d1e5c6fa9.png new file mode 100644 index 00000000..21fe3dd8 Binary files /dev/null and b/pics/61f8292b-eca0-4f46-a1be-f18d1e5c6fa9.png differ