Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was gonna mention this one as well! So simple and clever.

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



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: