Recall & Review
beginner
What is the main goal of the Rat in a Maze problem?
To find a path from the start point (usually top-left) to the destination point (usually bottom-right) in a maze represented by a grid, moving only through allowed cells.
Click to reveal answer
beginner
Which algorithmic technique is commonly used to solve the Rat in a Maze problem?
Backtracking, which tries possible paths and backtracks when a path leads to a dead end.
Click to reveal answer
beginner
In the Rat in a Maze problem, what does a cell value of 0 usually represent?
A blocked cell or wall where the rat cannot move.
Click to reveal answer
intermediate
What is the purpose of marking cells as visited in the Rat in a Maze problem?
To avoid revisiting the same cell and getting stuck in infinite loops during the search.
Click to reveal answer
intermediate
How do you represent the path found by the rat in the maze after solving the problem?
Usually by a matrix or grid of the same size where cells on the path are marked (e.g., with 1) and others are 0, showing the route from start to finish.
Click to reveal answer
In the Rat in a Maze problem, which move directions are typically allowed?
✗ Incorrect
The rat typically moves in four directions: up, down, left, right.
What does backtracking do when it hits a dead end in the maze?
✗ Incorrect
Backtracking returns to the previous cell to explore other possible paths.
What data structure is commonly used to store the maze in the Rat in a Maze problem?
✗ Incorrect
A 2D array or matrix is used to represent the maze grid.
If the maze is represented by a matrix, what does a cell value of 1 usually mean?
✗ Incorrect
1 usually means the cell is open and accessible.
What is the time complexity of the Rat in a Maze problem using backtracking for an N x N maze?
✗ Incorrect
Backtracking explores all possible paths, which can be exponential in the number of cells.
Explain how backtracking helps solve the Rat in a Maze problem step-by-step.
Think of exploring paths and undoing moves when stuck.
You got /5 concepts.
Describe how you would represent the maze and the path solution in code.
Focus on data structures and marking the route.
You got /5 concepts.
