Question: Answer the question appropriately or do not answer at all!!! This si the third time I've tried to receive a correct answer Problem 6. Show
Answer the question appropriately or do not answer at all!!! This si the third time I've tried to receive a correct answer
Problem 6. Show that, after cL1], c[2], cn are computed (using Cut Road or MemoizedCut), the best cutting of a rod of length n can be printed in O(n) time using only O(1) additional memory. CutRod(n) Memoized Cut(n) 1 make a new array cl0..nl 1 if cIn] 0 then return c already computed In] 2 if n 0 then return 0 the base case 3 for j 1 to n 3 cost 0 to compute the max cost 4 cost 0 for i 1 to n for i 1 to j cost F max cost, pli]-+MemoizedCut (n i cost max(cost, plil cli -ij) 6 cin cost 7 clil cost return cost 8 return cn Please answer the questions completely and thoroughly giving explanations along the way. This is the second time I have posted this...the first I received a non-sense answer. Both algorithms listed in the question are provided as well. I will give positive feedback for a clear and thorough explanation. Please do not answer the question unless the answer is complete. Thank you in advance for your help
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
