Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Sahilamin219's blog

By Sahilamin219, history, 3 years ago, In English

I was solving some DSU question and i m not able to understand when should we do path compression and when not . For example like in these two questions .

1.Redundant Connection

Solution 1

2.Redundant Connection II

Solution 2

For better idea of solution 2 visit

As you can see in 2nd question while finding cycle we are not doing path compression. If anyone can explain the concept behind this it would be very helpful.

  • Vote: I like it
  • +3
  • Vote: I do not like it