title: How can I find the actual path found by BFS?
body: <p>The problem I'm trying to solve concerns a tree of MRT system. </p>
  
  <p>Each node can be connected to 4 points at most, which simplify thing by a lot. Here's my thought.</p>
  
  <pre><code>struct stop {
      int path, id;
      stop* a;
      stop* b;
      stop* c;
      stop* d;
  };
  </code></pre>
  
  <p>I can write code to save all the information I need for BFS to search for all the points, but my main concern is that, even though BFS finds the point properly, how can I know its path?</p>
  
  <p>BFS will search each level, and when one of it reaches my destination, it will jump out of the run loop, and then, I will get a visited queue and an unvisited queue, how am i supposed to tell the user what stops he needs to visit when the visited queue is filled with every nodes BFS has searched?</p>