See Union Find
Find the Weak Connected Component in the Directed Graph (LI.432)
Connected Component in Undirected Graph (LI.431)
Last updated 5 years ago