You are given N cents (integer N) and have to break up the N cents into coins of 1 cent, 2 cents, 5 cents. Prove that greedy algorithm ALWAYS gives optimal solution

icon
Related questions
Question
You are given N cents (integer N) and have to break up the N cents into coins of 1 cent, 2 cents, 5 cents.
Prove that greedy algorithm ALWAYS gives optimal solution
Transcribed Image Text:You are given N cents (integer N) and have to break up the N cents into coins of 1 cent, 2 cents, 5 cents. Prove that greedy algorithm ALWAYS gives optimal solution
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer