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

Quiz: Minimum Spanning Trees · Question 4 of 10

Which data structure makes Kruskal's cycle check fast?

Which data structure makes Kruskal's cycle check fast?

  1. A.A stack
  2. B.A min-heap
  3. C.A trie
  4. D.Union-Find (disjoint set union)
Answer & explanation

Correct answer: Union-Find (disjoint set union)

find(u) == find(v) tells whether u and v are already connected, in nearly constant time.

Can you get the rest right without peeking?

Take the timed Quiz: Minimum Spanning Trees quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →