//find total number of Connected Components in a graph //implementation of dsu #include #define ll long long int using namespace std; ll find(ll x,vector&p) { if(p[x]==x) return x; else return p[x]=find(p[x],p); } void merge(ll a,ll b,vector&r,vector&p) { ll s1=find(a,p); ll s2=find(b,p); if(s1!=s2) { if(r[s1]>n>>m;//enter the number of vertices and number of edges vectorr(n,0); vectorp; for(int i=0;i>u>>v; u--; v--; merge(u,v,r,p); } mapmp; for(int i=0;i