A lot easier to code than the one in the tutorial. → Reply Arpa 9 years ago, # ^ | +2 Thanks for your suggestions first ! I proved that it is O(nlogn) : You know that why dsu has O(q log n) time (for q queries); the code uses same method. Merge smaller to greater...