Once you attempt the question then PrepInsta explanation will be displayed.

Kruskal’s algorithm involves the sorting of the edges, which takes O(E logE) time, where E is a number of edges in the graph, and V are the number of vertices. After sorting, all edges are iterated and the union-find algorithm is applied. union-find algorithm requires O(logV) time. So, overall Kruskal’s algorithm requires O(E log V) time.

Login/Signup to comment