🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Union-Find (Disjoint Set Union): all 10 questions

Quiz: Union-Find (Disjoint Set Union) · Question 1 of 10

In Union-Find, two elements are in the same set exactly when:

In Union-Find, two elements are in the same set exactly when:

  1. A.they have the same parent
  2. B.find returns the same root for both
  3. C.their indexes are next to each other
  4. D.one of them is a root
Answer & explanation

Correct answer: find returns the same root for both

Elements deeper in the tree can have different parents but still share one root.

Can you get the rest right without peeking?

Take the timed Quiz: Union-Find (Disjoint Set Union) quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →