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 16:30
Which type of computing device is best suited to having a digital pen as an input device? a. personal computer b. personal digital assistant c. smart television d. laptop e. mobile phone
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
Technician a says that with self-adjusting clutch systems, the release bearing constantly rotates. technician b says that the ball bearing portion of the release bearing should be lubricated with high-temperature grease during routine maintenance. which technician is correct?
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
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
Questions on the website: 13722367