Multiple choice

Which of the following algorithms solves the Minimum weight spanning tree problem?

  1. Greedy

  2. Depth-first search

  3. Dynamic programming

  4. Divide and conquer

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Minimum spanning tree algorithms like Prim's and Kruskal's use the greedy approach. They make locally optimal choices at each step (selecting the minimum weight edge that doesn't create a cycle) which leads to a globally optimal solution.