$\text{Kruskal's algorithm using union-find:} \\ \text{Time Complexity = Time taken for sorting edges + Picking edges one by one} \\ \text{from sorted edges so that it does not form a cycle} \\ = O(mlogm) + O(1) * O(m) \\ ( \because \text{ O(1) to check cycle using union find) } \\ = O(mlogm) + O(m) \\ = O(m log n^2) \left (\text {As m} = O(n^{2}) \right ) \\ = O(2mlogn) \\ = O(mlogn)$