i want to learn bfs & dfs,can someone provide me stl(c++) implementation of bfs?

It is a DFS problem. Simply find the no of components in the graph.

you are gettin WA…because if n==0 then ans=0 not 1.

how can i access map as a vector means how can i use map as vector there?how to access?

why we are getting wa,please help us