Back to the 2023 paper

Module 3: Graph and Tree Algorithms

20232m

Which of the following algorithms is used to find the minimum spanning tree in a weighted undirected 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 (also Prim's)

Kruskal (edge greedy) and Prim (vertex greedy) both find MST. Dijkstra is shortest path, Bellman-Ford handles negatives, Floyd all-pairs.

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.