algorithms.tutorialhorizon.com
Graph – Find Cycle in Undirected Graph using Disjoint Set (Union-Find) | Algorithms
Given a graph, check if the graph contains a cycle using disjoint set. Note: Disjoint-set data structure, also called a union–find data structure or merge–find set.