(Solved):Illustrate the execution of the Coin Change algorithm on n = 10 in the system of denominations d(1) = 1, d(2) = 5, and d(3) = 8 View Answer…

 

Question

Illustrate the execution of the Coin Change algorithm on n = 10 in the system of denominations

d(1) = 1, d(2) = 5, and d(3) = 8

 

EXPERT ANSWER

We will looking at the recursive implementation of the Coin Change Algorithm.

No of solution = C({1,5,8},10)

C = Count()

The recurrence formula – {eq}C(d[],m,n) = C(d[], m, n-d[m]) + C(d[], m-1, n)

{/eq}

The full recursion tree is as shown below. The green boxes are the final answer-

The

Scroll to top