How does Prim's algorithm find spanning trees?
The Prim's algorithm considers the nodes to be part of a single tree and adds new nodes to the spanning tree from the given graph.