Disjoint-set data structure: Difference between revisions

Content deleted Content added
m Finding set representatives: Add forgotten "of"
Merging two sets: Clarify rank storage requirements
Line 174:
'''end function'''
 
It can be shown that every node has rank <math>\lfloor \log n \rfloor</math> or less.<ref name="Cormen2009"/> Consequently theeach rank can be stored in {{math|''O''(log log ''n'')}} bits, makingand all the ranks can be stored in {{math|''O''(''n'' log log ''n'')}} bits. This makes the itranks an asymptotically negligible portion of the forest's size.
 
It is clear from the above implementations that the size and rank of a node do not matter unless a node is the root of a tree. Once a node becomes a child, its size and rank are never accessed again.