The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.

Tue 09 August 2022

New Book: The Recursive Book of Recursion by Al Sweigart

Posted by Al Sweigart in news   

My new programming book, the Recursive Book of Recursion, is released in August 2022. The book covers several classic recursive algorithms and breaks down recursion's fearsome reputation as a programming technique. The book has the code for its numerous programs in both Python and JavaScript. When you buy it direct from the publisher, No Starch Press, you'll receive a DRM-free ebook copy with your print book order.

Here's the contents of the book:

Part 1: Understanding Recursion

Chapter 1: What Is Recursion? - Explains recursion and how it is the natural result of the way programming languages implement functions and function

calls. This chapter also argues that recursion isn’t nearly the elegant, mystical concept many claim it is.

Chapter 2: Recursion vs. Iteration - Dives into the differences (and many similarities) between recursive and iterative techniques.

Chapter 3: Classic Recursion Algorithms - Covers famous recursive programs such as the Tower of Hanoi, the flood fill algorithm, and others.

Chapter 4: Backtracking and Tree Traversal Algorithms - Discusses a problem for which recursion is particularly suited: traversing tree data structures, such as when solving mazes and navigating a directory.

Chapter 5: Divide-and-Conquer Algorithms - Discusses how recursion is useful for splitting large problems into smaller subproblems and covers

several common divide-and-conquer algorithms.

Chapter 6: Permutations and Combinations - Covers recursive algorithms involving ordering and matching, as well as the common programming problems to which these techniques are applied.

Chapter 7: Memoization and Dynamic Programming - Explains some simple tricks to improve code efficiency when applying recursion in the real world.

Chapter 8: Tail Call Optimization - Covers tail call optimization, a common technique used to improve the performance of recursive algorithms, and how it works.

Chapter 9: Drawing Fractals - Tours the intriguing art that can be programmatically produced by recursive algorithms. This chapter makes use of turtle graphics for generating its images.

Part 2: Projects

Chapter 10: File Finder - Covers a project that searches through the files on your computer according to custom search parameters you provide.

Chapter 11: Maze Generator - Covers a project that automatically generates mazes of any size using the recursive backtracker algorithm.

Chapter 12: Sliding-Tile Solver - Covers a project that solves sliding-tile puzzles, also called 15-puzzles.

Chapter 13: Fractal Art Maker - Explores a project that can produce custom fractal art of your own design.

Chapter 14: Droste Maker - Explores a project that produces recursive, picture-in-picture images using the Pillow image-manipulation module.

Learn to program for free with my books for beginners:

Sign up for my "Automate the Boring Stuff with Python" online course with this discount link.