In the worse case, unionfind is O(m log n) and BFS/DFS is O(n + m) right?
Then the unionfind has strictly worse worst case execution time no?
In practice, where the graph is sparse, the unionfind can be much faster, but here I am only talking about big O time.
Correct me if I am wrong.
Question regarding UnionFind vs BFS/DFS


I have the similar questions when I learn UnionFind algorithm since lots of problems seem faster if using DFS/BFS over unionfind.
But StackOverflow has 2 great posts regarding DFSvsUF:
2.For time complexity, please check Runtime analysis: DFS vs. UnionFind for computing connected components of a static graph
I quote the conclusions:
a. "For static graph, DFS; Dynamic graph, UnionFind"
b. "That said, unionfind is helpful only if edges and vertices are never deleted."
c. "Unionfind has an extra multiplicative factor α(V), which makes it slower than DFS asymptotically (and probably practically as well)."