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 可以看到全部內容
|