Start learning →

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.
Practise this question with Quill — GATE CSE →

Keep practising Algorithms

Browse all Algorithms questions for GATE CSE, or explore more Computer Science topics.

Start a Algorithms lesson →
Related questions