@just_bhavana, consider the following line carefully
we have a single tree at any instance when applying Prim's algorithm.
Keyword - at any instance
According to CLRS - "Prims Algorithm will always generate connected tree at any instance of time during the process of generation of MST but Kruskal may give forest(a collection of disconnected trees) or a single tree"
64.3k questions
77.9k answers
244k comments
80.0k users