vector<int> adjLs[V]; // to change adjacency matrix to list for(int i = 0;i<V;i++) { for(int j = 0;j<V;j++) { // self nodes are not considered if(adj[i][j] == 1 && i != j) { adjLs[i].push_back(j); adjLs[j].push_back(i); } } }
vector<int> adjLs[V]; // to change adjacency matrix to list for(int i = 0;i<V;i++) { for(int j = 0;j<V;j++) { // self nodes are not considered if(adj[i][j] == 1 && i != j) { adjLs[i].push_back(j); adjLs[j].push_back(i); } } }