ALGORITHM LAB · DYNAMIC PROGRAMMING

Make 6 with the fewest coins

One amount per round: try each final coin, form a candidate, then compare counts.

Coin valuesUnlimited supply
Initialize · base case

Give amount 0 a known answer

Base case

Start with the simplest caseInitialize

Memory tabledp[x] = minimum coins

✓ Final · click an amount to jump

Index by amount (u = currency unit). Large numbers count coins; Last is the denomination stored in choice.

Apply the rules step by step

Follows the animation
Stage
General rule · why
At this step · apply the rule
Next →

This round’s candidates

Check every denomination
01 / 50