Proof that any node of rank $r$ has at least $2^r$ descendants implies that every node has rank at most $\lfloor \lg(n)\rfloor$

46 Views Asked by At

In the context of the union by rank algorithm (with respect to the disjoint-set data structure), I've read that since any node of rank $r$ has at least $2^r$ descendants, it follows that every node has rank at most $\lfloor \lg(n)\rfloor$. I have a proof sketch and I would like some feedback:

Proof: Assume that any node of rank $r$ has at least $2^r$ descendants, i.e., it has $f(r) \geq 2^r$ descendants. Taking the log of both sides, it follows that $\lg(f(r)) \geq r$. Since the maximum number of descendants for any node is $n$, it follows that $\lg n \geq r$. We also know that $x \leq y \Leftrightarrow x \leq \lfloor y \rfloor$. Hence $\lfloor \lg n \rfloor \geq r$.

Information about union by rank: https://en.wikipedia.org/wiki/Disjoint-set_data_structure#Union_by_rank