摘要:
BFS:起点入队;开始搜索:读取队首并出队,搜索范围有四周八个点(有的不存在),搜索到的点入队,并将歩长+1;直到读取的点等于终点;15MS372Kcode:#include #include #include #include using namespace std; struct point
{ int x; int y; int step;
}st,ed;
int x1,y1,x2,y2;
bool visit[10][10];
int xx[8] = {1,2,1,2,-1,-2,-1,-2};
int yy[8] = {2,1,-2,-1,2,1,-2,-1}; v... 阅读全文
posted @ 2013-05-06 22:35
简洁是智慧的灵魂
阅读(149)
评论(0)
推荐(0)

浙公网安备 33010602011771号