while creating adjacency matrix vector<list>v(n+1); where n is the number of nodes

if vector<list>v(n); like this it gives runtime error whyyy??

can anyone help plzz

plzz proide where i learn adjacency list perfectively using stl…

The snippet `vector<list>v(n);`

won’t compile - please format your code so that the forum software doesn’t mangle it!

How big is n, here? For many problems, they use 1 \le n \le 100000, and an adjacency matrix for n=100000 would be far too big to fit in memory.