#include using namespace std; class graph{ int v; list *adj; public: graph(int v); void addedge(int src,int dest); void printgraph(); void bfs(int s); }; graph::graph(int v){ this->v = v; this->adj = new list[v]; } void graph::addedge(int src,int dest){ src--;dest--; adj[src].push_back(dest); //adj[dest].push_back(src); } void graph::printgraph(){ for(int i=0;iv;i++){ cout<<"Adjacency list of vertex "<::iterator it; for(it=adj[i].begin();it!=adj[i].end();++it){ cout<<*it+1<<" "; } cout<v+1]; memset(visited,false,sizeof(visited)); visited[s]=true; list q; q.push_back(s); list::iterator it; while(!q.empty()){ int u = q.front(); cout<