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
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F672bf286-8abe-4b07-9ca1-0d5b2612956c%2Fbfaca144-dbc3-4447-9f6d-4bd062071b92%2Fni9r3f_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)