DFS with coloring would take O(V+E)
vs union find would take O(ElogV)
reference: http://www.geeksforgeeks.org/detect-cycle-undirected-graph/
So union find approach is slower. If V = 100, E = 100, DFS = 200, Union find is 1,000. Is there a reason to use Union find? I personally like it because it produces a clean code. Or anything I missed that union find is better in real practice?