🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Graphs Quiz: all 8 questions

Graphs Quiz · Question 6 of 8

Union-Find's union(a, b) returns False when a and b are already connected. In "Redundant Connection" this tells you…

Union-Find's union(a, b) returns False when a and b are already connected. In "Redundant Connection" this tells you…

  1. A.The current edge creates a cycle
  2. B.The graph is disconnected
  3. C.The graph is a tree
  4. D.Nothing useful
Answer & explanation

Correct answer: The current edge creates a cycle

If both ends already share a root, adding the edge closes a loop.

Can you get the rest right without peeking?

Take the timed Graphs Quiz quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →