How To detect cycle in a Graph *Union Find*?
How To detect cycle in a Graph *Union Find*?
Union-Find Algorithm can be used to check whether an undirected graph contains cycle or not. Note that we have discussed an algorithm to detect cycle. This is another method based on Union-Find. This method assumes that graph doesn't contain any self-loops