Assume that the coins are worth {1, 3, 4} and that the amount to be changed is 66. The greedy solution would lead to the accumulation of {1, 1, 4}, whereas the ideal answer would be {3, 3}.
A greedy algorithm chooses the best option that is currently available to solve a problem. It is unconcerned with whether the current best result will produce the final, ideal result.
Even when a decision is made incorrectly, the algorithm never goes back and changes it. It functions from the top down.
For all the problems, this greedy algorithm might not yield the best outcome. It does this because it consistently chooses the option that will result in the best global outcome.
The Benefits of a Greedy Approach:
Learn more about Greedy algorithm, here
https://brainly.com/question/13197481
#SPJ4