#include using namespace std; void prims(vector> adj[], vector &key, vector &parent, vector &mst, int V, int E, int &ans) { key[0] = 0; for(int count=0; count>V; cout<<"no of edges:"; cin>>E; vector> adj[V]; int u,v,wt; for(int i=0; i> u >> v >> wt; adj[u].push_back({v,wt}); adj[v].push_back({u,wt}); } vector key(V,INT_MAX); vector parent(V,-1); vector mst(V,false); int ans=0; prims(adj,key,parent,mst,V,E,ans); cout<