Write a function that computes Fibonacci(N) mod M, using only a constant amount of space for intermediate calculations.
What is the largest N for which Fibonacci(N) can be represented as a 64-bit integer?
Draw the tree corresponding to Figure 5.15 for the case where we exchange the recursive calls in Program 5.11.
Write a function that uses bottom-up dynamic programming to compute the value of P(N) defined by the recurrence:
P(N) = floor(N/2) + P(floor(N/2)) + P(ceiling(N/2)), for N >= 1, with P(0) = 0.
What is the best running time complexity you can attain for this problem using bottom-up dynamic programming?
Write a function that uses top-down dynamic programming to solve the previous exercise.
(This part is a challenge:) What is the best running time complexity you can attain for this problem using top-down dynamic programming?
Draw a tree similar to that of Figure 5.15, for your function from the previous exercise (textbook exercise 5.41), when invoked for N = 23.
Draw a plot of N versus the number of recursive calls that your function from textbook exercise 5.41 makes to compute P(N), for 0 <= N <= 1024.(For the purposes of this calculation, start your program from scratch for each N.)
Write a function that uses bottom-up dynamic programming to compute the value of CN defined by the recurrence
Write a function that uses top-down dynamic programming to solve the previous exercise.
Draw a tree similar to that of Figure 5.15, for your function from the previous exercise (textbook exercise 5.45), when invoked for N = 23.
Draw a plot of N versus the number of recursive calls that your function from textbook exercise 5.45 makes to compute CN, for 0 <= N <= 1024.(For the purposes of this calculation, start your program from scratch for each N.)
Back to the list of assignments.