Kruskal's algorithm of MST using tree-based partition representation with both union-by-size and path compression techniques