Let U be a set of points from $R^3$ and d:RxR $\to$ $R_{\geq0}$ an euclidean distance. For every partition of U with k classes, ($S_1$,...$S_k$), we define a quality of it as the shortest distance between 2 points from different classes. The below algorithm determines the partition of U with k classes with maximum quality.
https://i.stack.imgur.com/rpZBl.jpg
In the line 3, we build the particion of U with n classes, ({$P_1$},{$P_2$},...,{$P_n}), initializing a data structure for utilizing union-find procedures.
I need to justify the correctness of Kruskal-clustering algorithm and the time complexity. Any suggestions?