© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
M. IndenJava Challengeshttps://doi.org/10.1007/978-1-4842-7395-1_8

8. Recursion Advanced

Michael Inden1  
(1)
Zurich, Switzerland
 

In this chapter, you explore some more advanced aspects around recursion. You start with the optimization technique called memoization. After that, you 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.

8.1 Memoization

In Chapter 3, you learned that recursion is feasible for describing many algorithms and calculations in an understandable and, at the same time, elegant ...

Get Java Challenges: 100+ Proven Tasks that Will Prepare You for Anything now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.