i 想实施回收后转轨法,以解决马奇问题,但可以理解2.3指挥部(“拆除目前囚室和选定牢房之间的隔离墙”)会帮助我吗?
- Mark the current cell as Visited
- If the current cell has any neighbours which have not been visited
- Choose randomly one of the unvisited neighbours
- add the current cell to the stack
- remove the wall between the current cell and the chosen cell
- Make the chosen cell the current cell
- Recursively call this function
- else
- remove the last current cell from the stack
- Backtrack to the previous execution of this function
Edit In fact I want an algorithm to solve maze problem by using stack.