I like the explanation in the case study in Sedgewick's Algorithms [1].
Compare its simplicity to connected-components [2], another elegant algorithm but with a perhaps a bit more involved implementation.
1: https://algs4.cs.princeton.edu/15uf/
2: https://algs4.cs.princeton.edu/41graph/CC.java.html
I like the explanation in the case study in Sedgewick's Algorithms [1].
Compare its simplicity to connected-components [2], another elegant algorithm but with a perhaps a bit more involved implementation.
1: https://algs4.cs.princeton.edu/15uf/
2: https://algs4.cs.princeton.edu/41graph/CC.java.html