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

Prim's algorithm, at each step, adds:

Prim's algorithm, at each step, adds:

  1. A.the lightest edge that connects the current tree to a node outside it
  2. B.the lightest edge anywhere in the graph
  3. C.the node with the most edges
  4. D.the edge closest to the start in number of hops
Answer & explanation

Correct answer: the lightest edge that connects the current tree to a node outside it

Prim grows one tree; Kruskal picks the lightest edge anywhere that does not make a cycle.

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 →