Question: 1. Is selection sort a greedy algorithm? If so, describe all its characteristics (candidates, selection, solution, feasibility functions) 2. Suppose we are given coins worth
1. Is selection sort a greedy algorithm? If so, describe all its characteristics (candidates, selection, solution, feasibility functions)
2. Suppose we are given coins worth 30, 24, 12, 6, 3, and 1 units. Show that the greedy algorithm does not produce an optimal solution, even when unlimited supply of coins from each denomination is available. Hint: Give a counterexample!
3. Suppose we are given coins worth 50, 25, 20, 10, 5, 2.5, and 1 units. Prove or find a counterexample: When an unlimited supply of coins of each denomination is available, the greedy algorithm finds an optimal solution.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
