Question: Exercise 1 (Dynamic programming #1) Suppose you've have a strip of cloth of length L. You can cut the strip into shorter pieces, each of

 Exercise 1 (Dynamic programming #1) Suppose you've have a strip of

Exercise 1 (Dynamic programming #1) Suppose you've have a strip of cloth of length L. You can cut the strip into shorter pieces, each of an integer length 1, 2, , L and sell each piece The value of a piece of length l E [1,..., L) is pe. Your goal is to cut the cloth into the pieces that maximizes the amount of money you receive (i.e., the total value of the pieces). As an example, if the cloth has length L-4 and the values are Pi, p2,Pa,Pd = [2,3,7,7 then you should cut the cloth into one piece of length 1 and one piece of length 3, obtaining a total value of p+pa-9. Give the details of a dynamic programming algorithm to determine the maximum value that you can obtain by cutting the cloth. Your algorithm should run in 0(L2) time. Identify the subproblems, an ordering of subproblems, and the "smallest" subproblems

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!