Recently, I read this and was surprised that the time complexity of the union & find algorithm just with the path compression was O((m+n) log n)
, where m
is the number of 'find' queries and n
is the number of 'merge' queries.
I was interested in this complexity, (because I usually implement this algorithm without rank, and even when I applied union by rank upside down, the performance was not bad!) and tried to find an example which can make that time complexity. But because of the great power of path compression, it was really hard...
Is there any examples that can achieve Omega((m+n) log n)
, or is that complexity just theoretical, not practical?