Question
Which statement about Union-Find and Disjoint Set is the strongest interview answer?
- Union-Find and Disjoint Set is mostly a naming style choice and has little effect on runtime or design.
- Union-Find and Disjoint Set exists mainly to reduce the number of Java files in a project.
- Union-Find and Disjoint Set matters only for frontend frameworks, not for core Java applications.
- Union-find tracks which elements belong to the same connected component through representative parents.
Hint
Start with the core rule behind Union-Find and Disjoint Set.
Answer and rationale
Correct answer: D. Union-find tracks which elements belong to the same connected component through representative parents.
Union-find tracks which elements belong to the same connected component through representative parents. This is the base concept interviewers commonly test first.
Track: Java