Computers and Technology
Computers and Technology, 16.07.2020 03:01, Leftie500

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 prot 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 nd a path that maximizes the prot. 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 prot. Your algorithm need not output the path that gives the maximum possible prot. First write the recurrence relation to capture the maximum prot, 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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:30, jcollings44
You picked the corridor which led you here. if the guards find you, they're going to be really angry! what is the synonym of angry
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, lizz1228
Kto rozmawia z clamentain przez krótkofalówke w the walking dead w 4 epizodzie
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, Molly666
What does 21 pilots middle aged name as a band 15 years prior to them naming their band 21 pilots?
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
Do you know the correct answer?
You are in a rectangular maze organized in the form of M N cells/locations. You are starting at the...

Questions in other subjects:

Konu
Health, 29.06.2019 00:00
Konu
Mathematics, 29.06.2019 00:00