Techniques for speeding up merging of multiple sets
for x in X:
Y.add(x)
Repeat the merging of the elements of a set of size N into a set of size 1 with only the elements of each
If we decide to merge the smaller one into the larger one, this becomes O(NlogN)
This page is auto-translated from /nishio/小さい方から大きい方へ移す using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.