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

It's possible to maintain the "eclasses" without additional theoretical overhead. Associate a linked list with each representative, initially only containing the representative itself. When you union two representatives, concatenate their linked lists in constant time.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: