vector<Point> DFS(Point& s,Point& e,Point maze[][MaxSize],vector<Point> path,int bound)
{
for(...)
{
for(...)
}
open.push (s);
int flag=0,b=0;
while(!open.empty ()&&(flag!=1))
{
if(b>bound)break;
for(int i=0;i<4;i++)
{
b++;
neighbor=n+add[i];
int t=isValid(n,neighbor);
if(neighbor==e)
{
visited[neighbor.x][neighbor.y]=n;
visited[neighbor.x][neighbor.y].op.p =t;
flag=1;
break;
}
if(t!=-1&&visited[neighbor.x][neighbor.y]==Point())
{
open.push (maze[neighbor.x ][neighbor.y ]);
visited[neighbor.x][neighbor.y]=n;
visited[neighbor.x][neighbor.y].op.p =t;
}
}
}
......
return path;
}