title: Solve maze using queue data structure?
body: <p>I'm taking a class in data structures and was given the assignment to find the shortest path through a maze using C and implementing the queue data structure. However, I can't really wrap my head around how to use a queue here. </p>
  
  <p>I know the idea is to count every possible move from the start position, and when you hit the target, you're supposed to trace back to the initial position. This is what I don't understand. Because if I use a queue and delete all the moves that leads up to the target, I have no data to use to do the trace back, and if I don't delete the moves that lead to the target (i.e. saving all the possible moves and deleting them when I actually do the trace back), I might as well be using a stack. </p>
  
  <p>I know there's something I don't quite get, but I can't figure out what it is. How would I utilize the queue data structure in this case?</p>