mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
vault backup: 2022-06-11 11:52:24
This commit is contained in:
parent
564697a745
commit
c2de3b2c50
@ -161,6 +161,8 @@ If could happen that the sequence of Union operations does not create a rank tha
|
|||||||
### 3.4 UF 4
|
### 3.4 UF 4
|
||||||
Change find so it implements path compression to "flatten" the chains. When we follow tht path to a nodes representative we "learn" the final result
|
Change find so it implements path compression to "flatten" the chains. When we follow tht path to a nodes representative we "learn" the final result
|
||||||
|
|
||||||
|
path compression occurs during find when we the chain of links from an element to its representative with a direct link (and do the same along the chain)
|
||||||
|
|
||||||
```java
|
```java
|
||||||
if (x != reps[x]) {
|
if (x != reps[x]) {
|
||||||
reps[x] = find(reps[x]);
|
reps[x] = find(reps[x]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user