On wikipedia (https://en.wikipedia.org/wiki/Disjoint-set_data_structure#Proof_of_O(m_log*_n)_time_complexity_of_Union-Find), they prove that the amortized time for any m Find or Union operations on a disjoint-set forest containing n objects is O(m log* n), where log* denotes the iterated logarithm.
The proof is fairly easy to understand until the end (I screenshot it and don't copy paste it because it might change if it actually was wrong but it's currently the same on the link I provided): Several things are obscure to me:
- First, how do we get from
nlog*n
tomlog*n
, this sounds really wrong to me (or are we assumingm >= n
?). - I get that there are at most
log*n
buckets and there can't be more than2n/2^B
elements per bucket of size[B, 2^B-1]
. If I'm not mistaken there are mfind
operations that will make increasing-in-rank sequences with only distinct elements (since once we do afind
, it gets connected to the root so it won't matter anymore so there are no nodes that appear twice among all those increasing-in-rank sequences). But how do we extract any information from that?
I might be incorrect and misunderstanding something, I'm far from being an expert in Computer Science.