I have a project due in an hour, and I am stuck on it.
My project is to write some functions for a maze. ( Live regions, Dead Regions, and if it is possible to exit).
The point of the project is to understand graphs and specifically depth first search.
I am having no problems understanding those concepts.
What I need help with is storing/using a 2d boolean object for the visited array.
Here is what I assumed would work, but is not working... (DFS is overloaded)
private:
bool** visited;
void DFS() {
visited = new bool[11][55];
for (int i = 0; i < XMAX; i++) {
for (int j = 0; j < YMAX; j++) {
visited[i][j] = false;
}
}
DFS(0,0);
delete visited;
}