GRAPH DOUBT

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?

for(int x=0;x<adj[i].size();x++)
{
cout<<adj[i][x]<<"\n";
}
it is just trasversing each list and printing the element present in it .