Recursion/rat_maze.cpp
/* It mainly uses solveMazeUtil() to solve the maze problem using backtracking. Returns false if no path is possible, otherwise return true and prints the path in the form of 1s. There can be more than one solution , here it will take any of the feasible solution*/
It mainly uses solveMazeUtil() to solve the maze problem using backtracking. Returns false if no path is possible, otherwise return true and prints the path in the form of 1s. There can be more than one solution , here it will take any of the feasible solution
It mainly uses solveMazeUtil () to solve the maze problem using backtracking . Returns false if no path is possible otherwise return true and prints the path in the form of 1s . There can be more than one solution here it will take any of the feasible solution
bool solveMaze(int maze[N][N])
{
	int sol[N][N] = { { 0, 0, 0, 0 },
					{ 0, 0, 0, 0 },
					{ 0, 0, 0, 0 },
					{ 0, 0, 0, 0 } };
	if (solveMazeUtil(
			maze, 0, 0, sol)
		== false) {
		printf("Solution doesn't exist");
		return false;
	}
	printSolution(sol);
	return true;
}
bool solveMaze ( int maze [ N ] [ N ] ) { int sol [ N ] [ N ] = { { 0 , 0 , 0 , 0 } , { 0 , 0 , 0 , 0 } , { 0 , 0 , 0 , 0 } , { 0 , 0 , 0 , 0 } } ; if ( solveMazeUtil ( maze , 0 , 0 , sol ) == false ) { printf ( " " ) ; return false ; } printSolution ( sol ) ; return true ; }
It mainly uses solveMazeUtil() to solve the maze problem using backtracking.
It mainly uses solveMazeUtil () to solve the maze problem using backtracking .