迷宫最短路径(BFS)
摘要:
用队列实现广度优先搜索(BFS),找出最短路径。用栈保存走过的路径,并输出路径和标识最短路径的地图。输入用例: 0:路 1:墙壁24 240 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 00 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 00 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 00 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 00 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0.. 阅读全文
posted @ 2012-08-22 16:42 favourmeng 阅读(988) 评论(0) 推荐(0) 编辑