Question: Algorithm Design & Analysis Questions In a square maze, we can have multiple steps from s to reach e with one place that can only

Algorithm Design & Analysis Questions

  1. In a square maze, we can have multiple steps from s to reach e with one place that can only be visited once. '#' is the blockage and '.' is the available path that can be taken. Example:

Input

Output

3 s.. ..# .e#

4 These are the unique steps: *.. *.. **.

*.. **. .*.

**. .*. .*.

**. **. **.

4 .s.. .#.# #e.# ....

2 These are the unique steps: .**. ..*. .**. .**.

.**. ..*. .**. ....

The problem:

  • Input: an integer followed by the maze.
  • Output: total number of unique steps. (no need to print the unique steps)
  • Task: Design an algorithm in C/C++ code to print the total number of unique steps using a backtracking algorithm.

P.S:

- Please answer in a proper format - Please answer in a typed or softcopy format - Please don't do it with pen or pencil, do it with software or tools - If you want to ask any question, ask it in the comment section, I will try to answer it

Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!