Skip to content

Commit a8c0eff

Browse files
authoredOct 14, 2020
Update README.md
1 parent 963d53d commit a8c0eff

File tree

1 file changed

+4
-4
lines changed
  • Practice Problems/Backtracking/Rat In A Maze

1 file changed

+4
-4
lines changed
 

‎Practice Problems/Backtracking/Rat In A Maze/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
A Maze is given as N*N binary matrix of blocks where source block is the upper left most block i.e., maze[0][0] and destination block is lower rightmost block i.e., maze[N-1][N-1]. A rat starts from source and has to reach the destination. The rat can move only in two directions: forward and down.
55
In the maze matrix, 0 means the block is a dead end and 1 means the block can be used in the path from source to destination. Note that this is a simple version of the typical Maze problem. For example, a more complex version can be that the rat can move in 4 directions and a more complex version can be with a limited number of moves.
66

7-
Algorithm:
7+
**Algorithm:**
88
If destination is reached
99
print the solution matrix
1010
Else
@@ -37,10 +37,10 @@ The 1 values show the path of rat.
3737
```
3838

3939

40-
Complexity Analysis:
40+
### Complexity Analysis:
4141

42-
Time Complexity: O(2^(n^2)).
42+
**Time Complexity:** O(2^(n^2)).
4343
The recursion can run upperbound 2^(n^2) times.
4444

45-
Space Complexity: O(n^2).
45+
**Space Complexity:** O(n^2).
4646
Output matrix is required so an extra space of size n*n is needed.

0 commit comments

Comments
 (0)
Failed to load comments.