Question: Part 1 - recursive run of a sample rod cutting problem with memoization In class we discussed a sample run of the unrefined, recursive rod

Part 1- recursive run of a sample rod cutting problem with memoization
In class we discussed a sample run of the unrefined, recursive rod cutting algorithm, but also hinting at how to do the same problem using memoization. In this exercise, I want you to do memoization for this instance of the problem right away:
Lengths1234Prices1324
Run the algorithm on paper. Make sure to show every detail of that run. Use the notes of the demonstration I gave in class (go to class notes, Classes/Lecture 16- Rod Cutting) to see what I expect you to put on paper.
Based on that run, answer the following questions:
What is the value of the optimal solution? Just name the number.
What is the solution, i.e. how does the rod of 4 inches need to be cut? Show that you did recursive backtracking to get the result.
Part 2- bottom up run of the same, above problem
Now come up with the solution of the same problem above, but now use a bottom up approach. Convince yourself that you need to get the same results. For that reason, I only ask you to run the algorithm on paper, there are no questions as the answers would be the same.

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 Programming Questions!