Back to the 2025 paper

Module 3: Graph and Tree Algorithms

20252m

Which of the following algorithms is commonly used to find the Minimum Spanning Tree of a graph?

(i) Dijkstra's Algorithm
(ii) Kruskal's Algorithm
(iii) Bellman-Ford Algorithm
(iv) Floyd-Warshall Algorithm

Worked SolutionAI Assisted

Answer: (ii) Kruskal's Algorithm

Explanation:

  • Minimum Spanning Tree (MST) of a connected, undirected, weighted graph is found by greedy MST algorithms:
    • Prim's: grows tree from a vertex, repeatedly adds minimum-weight edge crossing cut. O(Elog⁡V)O(E \log V).
    • Kruskal's: sorts all edges, adds edges in increasing order skipping those forming a cycle (using Union-Find). O(Elog⁡E)O(E \log E).
  • Dijkstra's, Bellman-Ford, Floyd-Warshall solve shortest paths, not MST.
  • Both Prim's and Kruskal's are valid; here the option listed is Kruskal's.

Correct choice: (ii) Kruskal's Algorithm (Prim's would also be correct if listed).

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.