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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:40, hussain34
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, BreadOfTheBear
What statement best describes operating systems? it’s possible for modern computers to function without operating systems. most operating systems are free or very inexpensive. operating systems are managed by the computer’s microprocessor (cpu). operating systems manage the computer’s random access memory (ram).
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, jaymc1932
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
image
Computers and Technology, 24.06.2019 01:00, bellamyciana
What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the file tab. click the file tab, then click print, or click the page layout tab. click the page layout tab, or click the review tab. click the review tab, or click the home tab?
Answers: 2
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 in other subjects:

Konu
Physics, 31.10.2020 14:00
Konu
History, 31.10.2020 14:00
Konu
Mathematics, 31.10.2020 14:00
Konu
Chemistry, 31.10.2020 14:00
Konu
Mathematics, 31.10.2020 14:00
Konu
Mathematics, 31.10.2020 14:00