Practice free →
HomeGATE CSEcomputerscienceAlgorithms › The running time of Kruskal's algorithm with Uni…

The running time of Kruskal's algorithm with Union-Find is

AO(V²) regardless of E
BO(V³) regardless of E
CO(V × E) brute force
DO(E log V) using sort
Answer & Solution
Correct answer: D. O(E log V) using sort
Sorting the E edges costs O(E log E) = O(E log V) since E ≤ V². The Union-Find operations are O(α(V)) per call, essentially O(1) amortised over the E edges. Sort dominates. O(V²) or O(VE) describe naive approaches without sorting or Union-Find.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions