Doubt in C++ STL Quiz II

Which of the following can be used to store a simple undirected graph with N nodes?

vector < int > graph [ N + 1 ]

bool graph [ N + 1 ][ N + 1 ]

vector < vector < int > > graph(N+1)

All of them.

Option 1 can’t be selected as we have a 1 D vector, so, how
can we store a graph in that?

@mgfags option 1 is array of vectors you can make graph like graph[u].pb(v) . it is similar to what sir taught. i hope its cleared if yes dont forget to mark resolved :smiley: