Making Change
# Making Change
# Problem Formulation
Note that The minimum number of coins to form value x, is 1 + the minimum of the solutions to value $x-d_1, x-d_2….x-d_k$
We can form the following recurrence equations: Base case (when n-d less than 0): $$change(n)=0, \forall i\in{1,…,m},n-d_i < 0$$ Finding the minimum of subproblems: $$change(n)=\min_{i=1…m,d_i\le n}(1+change(n-d_i))$$
# Strategy
# Pseudocode
|
|