Question: Problem Python programming language and compare the efficiency of those in terms of the number of recursive calls made or a number of iterations for

Problem Python programming language and compare the efficiency of those in terms of the number of recursive calls made or a number of iterations for the pseudo algorithm 3.

Your implement should follow the pseudocode provided in the textbook/lecture and use sample prices with pi dollars of revenue for the length i in the table below for testing, then you can define pi dollars for lengths.

length i 1 2 3 4 5 6 7 8 9 10
price pi 1 5 8 9 10 17 17 20 24 30

For this set you need to give code for 3 type of algorithm Recursive top-down implementation, Recursive top-down implementation with memoization, Recursive bottom-up implementation with memorization

2. Test your implementations:

a. A user will enter a number for n, the size of the rod.

b. For each of the algorithms, determine the optimal revenue rn (n = 1..10) and display the revenue. For the bottom-up implementation, also determine a choice that led to the optimal value, and display the best decompositions of the n.

c. For each of the algorithms, count a total number of recursive calls or iterations when determining rn and display/compare them.

d. Repeat a-c at least 5 times and show the results.

e. find the running time of real code (code for all three case)

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!