auto commit
This commit is contained in:
parent
b8896a1da1
commit
da364e7a62
|
@ -377,7 +377,7 @@ public void union(int p, int q) {
|
|||
|
||||
但是 find 操作开销很大,因为同一个连通分量的节点 id 值不同,id 值只是用来指向另一个节点。因此需要一直向上查找操作,直到找到最上层的节点。
|
||||
|
||||
<div align="center"> <img src="../pics//c5043b7e-6efe-4c55-b663-272e1097ed21.png" width="300"/> </div><br>
|
||||
<div align="center"> <img src="../pics//61f8292b-eca0-4f46-a1be-f18d1e5c6fa9.png" width="300"/> </div><br>
|
||||
|
||||
```java
|
||||
public int find(int p) {
|
||||
|
|
BIN
pics/61f8292b-eca0-4f46-a1be-f18d1e5c6fa9.png
Normal file
BIN
pics/61f8292b-eca0-4f46-a1be-f18d1e5c6fa9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Loading…
Reference in New Issue
Block a user