Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 43s1 days 16 hours 1 minutes 43 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 43s1 days 16 hours 1 minutes 43 seconds.

Sign in to watch this lesson
Algorithms - Trees and Range Queries · 4:55
A disjoint set union stores groups as a forest of parent pointers, where each root names its set. We build it from make_set, find_set and union_sets, watch path compression flatten a tall tree and union by size keep every tree at most log2 n tall, then measure the plain version against both tricks and see why alpha(n) is constant in practice.