Question: 2 . ( 2 5 points ) Modify the pseudocode of the algorithm given in class for the solution of the change - making problem

2.(25 points) Modify the pseudocode of the algorithm given in class for the solution of the change-making problem such that it returns the actual coin denominations making up the solution, rather than the minimum number of coins required, to give a change for amount \( n \). You can construct a list, and add to this Ilst the possible coin values during the execution of your algorithm. Important: You should come up with proper modifications to the ariginal aigorithm given in class as an answer to this problem: Algonithms written with completely different approaches and/or in pseudocode notations rodically different than the one we have been using in the closs will NOT be oucepted.
Algorithm ChangeMaking (D)[1.m], n]
cointist - I //List is initially empty.
//On the course of execution, we add
//some value to the list (when to add
//depends on your implementation),
cointist.add(some volue)
return coinList
Determine the running time complexity of your algorithm. You can assume that list operations take constant amount of time, lie. \( O(1)\). What is the space complexity of your algorithm?
2 . ( 2 5 points ) Modify the pseudocode of the

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!