Question: 2 . ( 2 5 points ) Modify the pseudocode of the algorithm given in class for the solution of the change - making problem
points Modify the pseudocode of the algorithm given in class for the solution of the changemaking 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 andor in pseudocode notations rodically different than the one we have been using in the closs will NOT be oucepted.
Algorithm ChangeMaking Dm 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.addsome volue
return coinList
Determine the running time complexity of your algorithm. You can assume that list operations take constant amount of time, lie. O What is the space complexity of your algorithm?
Step 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
