I am trying to use an array to store the path found from Iterative deepening depth-first search algorithm.
I have N vertexs and I want to store the path from vertex X to vertex Y by the array pathTo[N] with pathTo[W] = V means node W will be visited from node V i.e V is the parent of W in dfs tree. (So by tracing parents back from N, we can find the path that leads to N.)
Can anyone help me to implement it in pseudo code ? I will try to learn from it.
I have tried reading other posts about this problem but I still can't understand at all.