07-23-2014, 01:43 PM
For idea of question number 1: Look at this exmple:
Suppose you have to give Money-Change for the amount of Rs.18 with least possible number of coins/notes. Currently the denominations for Pakistan currency system in Rupees are coins of 1, 2, 5 and paper notes of 10, 20, 50, 100, 500, 1000, and 5000.
You are required to determine whether the Greedy-approach gives optimum value or not in this case by calculating the required number of total coins/bills through both the solution methods.
Using Greedy algorithm
3.jpg (Size: 87.29 KB / Downloads: 464)
Suppose you have to give Money-Change for the amount of Rs.18 with least possible number of coins/notes. Currently the denominations for Pakistan currency system in Rupees are coins of 1, 2, 5 and paper notes of 10, 20, 50, 100, 500, 1000, and 5000.
You are required to determine whether the Greedy-approach gives optimum value or not in this case by calculating the required number of total coins/bills through both the solution methods.
Using Greedy algorithm
3.jpg (Size: 87.29 KB / Downloads: 464)
