I am trying to solve some problems based on Graph using C++ I am very beginner in Graph theory and solving graph related problems.
I have come across many representation of graph
1 . Declaring
vector<int>adj: global declaration with Predefined size
2 . locally declaring
vector<int > adj[n]: here n is as per input size in test case
Could some one please explain which one is better approach. I am bit confused in this.