January 2020
Intermediate to advanced
470 pages
11h 13m
English
The third general strategy, dynamic programming, assumes that you will have to solve many smaller problems, but, instead of using recursion each and every time, it depends on you having stored the previously found solutions... memoization, in other words! In Chapter 4, Behaving Properly – Pure Functions, and later in a better fashion in Chapter 6, Producing Functions – Higher-Order Functions, we already saw how to optimize the calculations of the usual Fibonacci series, avoiding unnecessary repeated calls. Let's now consider another problem.
Given a certain number of dollars and the list of existing bill values, calculate in how many different ways we can pay that amount of dollars with different combinations ...
Read now
Unlock full access