You are given N cents (integer N) Break up N cents into coins of 1 cent, 2 cent, 5 cents. Using a memoized algorithm, return the smallest number of coins needed to do this. (Ex: if your algorithm is called B, and N = 13, then B(N) B(13) returns 4, since 5+5+2+1 = 13 used the smallest number of coins. In contrast, 5+5+1+1+1 is not an optimal answer.) Draw the recursion tree for this. Derive complexity bound of algorithm, no proving needed just derive it by going through each component in the algorithm.
You are given N cents (integer N) Break up N cents into coins of 1 cent, 2 cent, 5 cents. Using a memoized algorithm, return the smallest number of coins needed to do this. (Ex: if your algorithm is called B, and N = 13, then B(N) B(13) returns 4, since 5+5+2+1 = 13 used the smallest number of coins. In contrast, 5+5+1+1+1 is not an optimal answer.) Draw the recursion tree for this. Derive complexity bound of algorithm, no proving needed just derive it by going through each component in the algorithm.
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images