Question: solve Here is a modified version of the pseudocode for the optimal solution to the Coin Changing problem: A = empty list which can grow
solve
Here is a modified version of the pseudocode for the optimal solution to the Coin Changing problem: A = empty list which can grow as needed A[O] = 0 C = list of coin denominations for x = 1 to n inclusive: howmanycoins = infinity for each coin in C with coin = 0: howmanycoins = min(howmanycoins ,i+A[x-coin]) end if end for A[x] = howmanycoins end for Suppose we know that the code before the outermost for loop takes time c,, the body of the innermost for loop takes time cg, and nothing else takes any time at all. For each of the following, write down a simplified expression for the total time taken by the algorithm and then write down a one of our nice functions g(n) so T(n) = O(g(n)). (a) The country issues k different coins where at least one is a l coin. T(n) = which is 0 of . (b) The country issues infinitely many coins with denominations 1, 3, 5, Te, ... T(n) = which is 0 of (c) The country issues infinitely many coins with denominations 1, 10, 100, 1000e, .. T(n) = which is 0 of (d) Explain why the with coinStep by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
