Intermediate
Data Structures & Algorithms
Q49 / 100
What is the Union-Find (Disjoint Set Union) data structure used for?
Correct! Well done.
Incorrect.
The correct answer is B) Efficiently determining if two elements belong to the same component and merging components
B
Correct Answer
Efficiently determining if two elements belong to the same component and merging components
Explanation
Union-Find supports union and find operations. With path compression and union by rank, both operations run in near-O(1) (O(α(n)) amortized). Used in Kruskal's and cycle detection.
Progress
49/100