guilty0225
|
分享:
▼
x0
|
[C/C++][求助] 老鼠走迷宫
不好意思~想请问大大们 我这有道问题是问说老鼠走迷宫是用BFS(广度优先搜寻)还是DFS(深度优先搜寻)哪个比较好 要怎么用程式证明? 以下是我所知的BSF程式 DFS大大们会怎写? #include <cstdio> #include <list> #define SIZE 10 using namespace std; int ex=9,ey=9; typedef struct _node{ int x; int y; int step; }NODE; int maze={ {0,0,0,0,0,1,1,1,1,1}, {1,0,1,1,1,1,0,0,0,1}, {1,0,0,0,1,1,0,1,1,1}, {1,0,1,0,0,0,0,0,0,1}, {1,0,1,0,1,1,0,1,0,1}, {1,0,1,0,1,1,1,1,0,1}, {1,0,1,0,1,1,0,0,0,1}, {1,1,1,0,0,0,0,1,0,1}, {1,0,0,0,1,1,1,1,0 .. 访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容
|