Do this in C++
Construct an adjacency-list implementation of a directed,unweighted graph, and then use it to implement thebreadth-first and depth-first search algorithms.
Write an implementation of the adjacency listgraph representation.
The graph must contain:
1. graph(n): constructor with n nodes and no edges
2. void add_edge(int a, int b)
3. bool has_edge(int a, int b)
4. int count_nodes(): Returns the total number of nodes in thisgraph.
5. int count_edges() : Returns the total number of edges in thisgraph.
6. int count_edges(int n): Returns the number of outbound edgesfrom node n.
7. std::vector bfs(int n): Perform a breadth-first search,starting at node n, and returning a vector that gives the distanceto
PayPal Gateway not configured
PayPal Gateway not configured