title: Printing shortest path from unweighted graph
body: <p>I have an oriented graph represented as Adjacency List : </p>
  
  <p><a href="https://i.stack.imgur.com/ChkHZ.png" rel="nofollow"><img src="https://i.stack.imgur.com/ChkHZ.png" alt="enter image description here"></a></p>
  
  <pre><code>class Graph
  {
      private:
          struct Node
          {
              Node *next;
              int vertex;
              Node( int vertex )
              {
                  this -&gt; vertex = vertex;
                  this -&gt; next = nullptr;
              }
          };
  
          Node ** graph;
          int V;
  
  public:
      Graph(int size)
      {
          V = size;
          graph = new Node*[V];
          for ( int i = 0; i &lt; V; i++ )
              graph[i] = nullptr;
      }
  
     // Add edge from Source to destination
     void addEdge( int source, int destination )  
     {
        Node * ref = graph[from];
        graph[from] = new Node( to );
        graph[from] -&gt; next = ref;
     }
  
    void bfs ( int s, int dest )
    {
     // ...
    }
  </code></pre>
  
  <p>I have implemented bfs which gives me the shortest path from node A to node B but I don't know how to effectively save that path and then print it. Any idea how to solve it?</p>