练习了一下bfs算法
经典的二维图移动到终点问题
使用的关键函数如下
int min_steps(struct point* bfs, int nums)
{
printf("234\n");
struct point next_bfs[nums * 4];
printf("345\n");
int next_nums = 0;
for(int i = 0; i < nums; i++)
{
int l = bfs[i].l;
int c = bfs[i].c;
if(!((0 <= l && l < MAX_LINE) && (0 <= c && c < MAX_COLUMN)))
continue;
if(bfs[i].path_map[l][c] == 1)
continue;
if(a[l][c] == 1)
continue;
if(l == (MAX_LINE - 1) && c == (MAX_COLUMN - 1))
return 1;
bfs[i].path_map[l][c] = 1;
next_bfs[next_nums].l = l + 1;
next_bfs[next_nums].c = c;
//p1.path_map = bfs[i].path_map;
two_dimension_array_copy(next_bfs[next_nums].path_map, bfs[i].path_map);
ne