void printGraph(vector adj[], int V)
{
for (int i = 0; i < V; i++)
{
for (int x : adj[i])
cout << x <<" “;
cout<<”\n";
}
}
This is adjacency list represetation of graph and the above function prints the whole graph.
for (int x : adj[i])
cout << x <<" ";
Can someone please rewrite this part of code and explain me?