Consider the following graph and Assume node ‘P’ as the starting vertex for Prim’s algorithm. Which of the following can be the correct order of edges in which they are added to construct Minimum Spanning Tree (MST)?
Assuming you have knowledge of How prim algo works I have explained this answer.
The main thing is in prims algorithm is that when you at a node then you have to choose least weight edge unless it is not forming the cycle. Follow this rule you will get the correct answer as option B.