In this chapter, you will explore some advanced aspects around recursion. You’ll start with the optimization technique called memoization. After that, you’ll look at backtracking as a problem-solving strategy that relies on trial and error and tries out possible solutions. Although this is not optimal in terms of performance, it can keep various implementations comprehensible.
7.1 Memoization
In Chapter 3, you saw that recursion is feasible for describing many algorithms and calculations in an understandable and, at the same time, ...