Backtracking/Rat in a Maze/C/rat_in_a_maze.c
/* This function solves the Maze problem using Backtracking.  It mainly 
   uses solveMazeUtil() to solve the problem. It returns false if no  
   path is possible, otherwise return true and prints the path in the 
   form of 1s. Please note that there may be more than one solutions,  
   this function prints one of the feasible solutions.*/
This function solves the Maze problem using Backtracking.  It mainly
uses solveMazeUtil() to solve the problem. It returns false if no
path is possible, otherwise return true and prints the path in the
form of 1s. Please note that there may be more than one solutions,
this function prints one of the feasible solutions.
This function solves the Maze problem using Backtracking . It mainly uses solveMazeUtil () to solve the problem . It returns false if no path is possible otherwise return true and prints the path in the form of 1s . Please note that there may be more than one solutions this function prints one of the feasible solutions .
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 ; }
This function solves the Maze problem using Backtracking.
This function solves the Maze problem using Backtracking .