🎙 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 8 of 10

Which task can Union-Find NOT do on its own?

Which task can Union-Find NOT do on its own?

  1. A.Tell whether two people are in the same friend circle
  2. B.Count the groups after many merges
  3. C.Detect a cycle in an undirected graph
  4. D.Remove a friendship and split a group again
Answer & explanation

Correct answer: Remove a friendship and split a group again

DSU only supports merging. Splitting needs a different structure or processing the operations in reverse.

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 →