subject

You are in a rectangular maze organized in the form of M × N cells/locations. You are starting at the upper left corner (grid location: (1, 1)) and you want to go to the lower right corner (grid location: (M, N)). From any location, you can move either to the right or to the bottom, or go diagonal. I. e., from (i, j) you can move to (i, j + 1) or (i + 1, j) or to (i+ 1, j + 1). Cost of moving right or down is 2, while the cost of moving diagonally is 3. The grid has several cells that contain diamonds of whose value lies between 1 and 10. I. e, if you land in such cells you earn an amount that is equal to the value of the diamond in the cell. Your objective is to go from the start corner to the destination corner. Your profit along a path is the total value of the diamonds you picked minus the sum of the all the costs incurred along the path. Your goal is to find a path that maximizes the profit. Write a dynamic programming algorithm to address the problem. Your algorithm must take a 2-d array representing the maze as input and outputs the maximum possible profit. Your algorithm need not output the path that gives the maximum possible profit. First write the recurrence relation to capture the maximum profit, explain the correctness of the recurrence relation. Design an algorithm based on the recurrence relation. State and derive the time bound of the algorithm. Your algorithm should not use recursion.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:30
Asuccessful format string attack attempted to steal user account information by reading from unauthorized memory. answer the followings with proper explanation a)this attack will lead to violation of which security policies?
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
question
Computers and Technology, 24.06.2019 13:20
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
question
Computers and Technology, 25.06.2019 06:00
Sam needs to create a spreadsheet for his coworkers. they will need to follow a crossed a long road of data. sam would like to make his spreadsheet easy to read. sam should
Answers: 1
You know the right answer?
You are in a rectangular maze organized in the form of M × N cells/locations. You are starting at th...
Questions
question
Social Studies, 27.06.2019 03:30
Questions on the website: 13722361