Question: All algorithms are in pseudocode? Problem 3. (15p) Give an algorithm that solves mazes. The maze isa rectangular maze (see picture below) with r rows
All algorithms are in pseudocode?

Problem 3. (15p) Give an algorithm that solves mazes. The maze isa rectangular maze (see picture below) with r rows and c columns, given in the form of a function IsWall(i, j, D) that tells you, in O(1)-time, whether you can or cannot move from square (,j) in direction D - where D {Up, Down; Left: Right). You are also given a start position s = (i, j) and a finish position f = (i, j'). Your goal is to find the shortest path taking you from s to f (if such a path exists). Your algorithm must run in O(r c) time. Explain why your algorithm is correct and why its runtime is O(rc s\ GHLELH Figure 1: Rectangular maze Problem 3. (15p) Give an algorithm that solves mazes. The maze isa rectangular maze (see picture below) with r rows and c columns, given in the form of a function IsWall(i, j, D) that tells you, in O(1)-time, whether you can or cannot move from square (,j) in direction D - where D {Up, Down; Left: Right). You are also given a start position s = (i, j) and a finish position f = (i, j'). Your goal is to find the shortest path taking you from s to f (if such a path exists). Your algorithm must run in O(r c) time. Explain why your algorithm is correct and why its runtime is O(rc s\ GHLELH Figure 1: Rectangular maze
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
