Author(s): Al Sweigart
Publisher: No Starch Press, Year: 2022Description:
Recursion, and recursive algorithms, have a reputation for being intimidating. They’re seen as an advanced computer science topic often brought up in coding interviews. Moreover, coders often perceive the use of a recursive algorithm as a sophisticated solution that only true programmers can produce. But there’s nothing magical about recursion. Its fearsome reputation is more a product of poor teaching than of the complexity of recursion itself.
The book also explains tail call optimization and memoization, concepts often employed to produce effective recursive algorithms, and the call stack, which is a critical part of how recursive functions work but is almost never explicitly pointed out in lessons on recursion. The last chapter, on fractals, culminates with examples of the beautiful fractal shapes recursion can produce.