Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
Buy new:
-20% $32.17
FREE delivery Monday, February 9 on orders shipped by Amazon over $35
Ships from: Amazon.com
Sold by: Amazon.com
$32.17 with 20 percent savings
List Price: $39.99 Image
Get Fast, Free Shipping with Amazon Prime
FREE delivery Monday, February 9 on orders shipped by Amazon over $35
Or Prime members get FREE delivery Saturday, February 7. Order within 9 hrs 12 mins.
Only 12 left in stock (more on the way).
$$32.17 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$32.17
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Shipper / Seller
Amazon.com
Amazon.com
Shipper / Seller
Amazon.com
Returns
FREE 30-day refund/replacement
FREE 30-day refund/replacement
This item can be returned in its original condition for a full refund or replacement within 30 days of receipt.
Read full return policy
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
$20.08
Very Good Condition - May show some limited signs of wear and may have a remainder mark. Pages and dust cover are intact and not marred by notes or highlighting. Very Good Condition - May show some limited signs of wear and may have a remainder mark. Pages and dust cover are intact and not marred by notes or highlighting. See less
FREE delivery February 12 - 18. Details
Or fastest delivery February 10 - 12. Details
Only 14 left in stock - order soon.
$$32.17 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$32.17
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Access codes and supplements are not guaranteed with used items.
Ships from and sold by bellwetherbooks.
Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the author

Get new release updates & improved recommendations
Something went wrong. Please try your request again later.

The Recursive Book of Recursion: Ace the Coding Interview with Python and JavaScript

4.9 out of 5 stars (65)

{"desktop_buybox_group_1":[{"displayPrice":"$32.17","priceAmount":32.17,"currencySymbol":"$","integerValue":"32","decimalSeparator":".","fractionalValue":"17","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"nPCC5XsTNqNlFNmYLn8u30S47IEkfWqBCRUFSRVnx5uK8owfXgyb4L5s%2BCz2chzp1NhbIzcNnvWTg3%2BAu3W9WwfGPKFn1etIs5LfoAaPbTZcI0gu6Odcn5qwokSvqgwlb36lWZm5y8zIybm0djUb8A%3D%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$20.08","priceAmount":20.08,"currencySymbol":"$","integerValue":"20","decimalSeparator":".","fractionalValue":"08","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"nPCC5XsTNqNlFNmYLn8u30S47IEkfWqBdPfDC2ujVYfNDxeC%2Fkkqr0iRm6AyLyKAjlVzKKhEA4the8Nbh%2BaU5D28X%2FlFBOT%2Brsp4Bs0TPejlgRZEFdT8lH3xlIx7RDRs77UATYfTImGT%2FupGv%2B1B0m2pO70WXvDH5C6UhS4Xue6zVGh9cqbg3w%3D%3D","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}

Purchase options and add-ons

An accessible yet rigorous crash course on recursive programming using Python and JavaScript examples.

Recursion has an intimidating reputation: it’s considered to be an advanced computer science topic frequently brought up in coding interviews. But there’s nothing magical about recursion.

The Recursive Book of Recursion uses Python and JavaScript examples to teach the basics of recursion, exposing the ways that it’s often poorly taught and clarifying the fundamental principles of all recursive algorithms. You’ll learn when to use recursive functions (and, most importantly, when not to use them), how to implement the classic recursive algorithms often brought up in job interviews, and how recursive techniques can help solve countless problems involving tree traversal, combinatorics, and other tricky topics.

This project-based guide contains complete, runnable programs to help you learn:

  • How recursive functions make use of the call stack, a critical data structure almost never discussed in lessons on recursion
  • How the head-tail and “leap of faith” techniques can simplify writing recursive functions
  • How to use recursion to write custom search scripts for your filesystem, draw fractal art, create mazes, and more
  • How optimization and memoization make recursive algorithms more efficient

Al Sweigart has built a career explaining programming concepts in a fun, approachable manner. If you’ve shied away from learning recursion but want to add this technique to your programming toolkit, or if you’re racing to prepare for your next job interview, this book is for you.

Frequently bought together

This item: The Recursive Book of Recursion: Ace the Coding Interview with Python and JavaScript
$30.55
Get it as soon as Wednesday, Feb 18
Sold by RoseBookz and ships from Amazon Fulfillment.
+
$30.99
Get it as soon as Monday, Feb 9
In Stock
Ships from and sold by Amazon.com.
+
$31.06
Get it Feb 12 - 19
Only 1 left in stock - order soon.
Ships from and sold by GF Books, Inc..
Total price: $00
To see our price, add these items to your cart.
Details
Added to Cart
Some of these items ship sooner than the others.
Choose items to buy together.

Customers also bought or read

Loading...

Editorial Reviews

Review

"This book takes the mystery out of recursion. By the time you finish it, you'll see recursion as a powerful technique, but also a technique usable by mere mortals."
—John D. Cook

"... this book is a worthy read for a developer who wants to deepen their knowledge of advanced programming topics. While basic recursion is included in early programming curriculum, it typically stops at examples that can be reproduced with iteration. In this book, Al Sweigart starts are these basics and quickly expands to include types of algorithms that benefit from recursion, such as tree traversal and divide-and-conquer. Though focused on those actively interviewing for engineering roles, the book is also a good fit for professional development, an engineering book club, or a brain tickler for your technical book shelf. The real life projects at the end are especially informative, which is why I think... (this review 'recurs' to the beginning)"
—Adam DuVander, @adamd, Founder of EveryDeveloper

"I have felt for a long time that I had a pretty good handle on the subject of recursion . . . Thanks to Al Sweigart's new book, I think I'm far better informed than I was before. I will re-read this book a couple more times, just to add to the knowledge."
—Ronnie Tucker, Editor, Full Circle Magazine

About the Author

Al Sweigart is a software developer and tech book author living in Houston. Python is his favorite programming language, and he is the developer of several open source modules for it. His other books are freely available under a Creative Commons license on his website at https://www.inventwithpython.com/.

Product details

  • Publisher ‏ : ‎ No Starch Press
  • Publication date ‏ : ‎ August 16, 2022
  • Language ‏ : ‎ English
  • Print length ‏ : ‎ 328 pages
  • ISBN-10 ‏ : ‎ 1718502028
  • ISBN-13 ‏ : ‎ 978-1718502024
  • Item Weight ‏ : ‎ 1.35 pounds
  • Dimensions ‏ : ‎ 7 x 0.75 x 9.25 inches
  • Best Sellers Rank: #231,980 in Books (See Top 100 in Books)
  • Customer Reviews:
    4.9 out of 5 stars (65)

About the author

Follow authors to get new release updates, plus improved recommendations.
Al Sweigart
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Al Sweigart is a software developer and tech book author living in Houston. He has written several programming books for beginners, including Automate the Boring Stuff with Python. His books are freely available under a Creative Commons license at his website https://inventwithpython.com.

Customer reviews

4.9 out of 5 stars
65 global ratings
A must to have book which can make a good developer a great developer.
5 out of 5 stars
A must to have book which can make a good developer a great developer.
Recursion is a complex topic to understand in the first place no matter which language we chose to pick to implement the concepts. In this book, Al starts with the intuition of what is recursion via multiple examples, and gradually moved towards defining many condepts like functions, stacks, call stack and so on. I loved the second chapter on Recursion vs Iteration which build a foundation on taking the decision on when to use recursion and when not to. I would strongly recommend to go over chapter 1 to chapter 3 even if you are well verged with recursion/DP, this 3 chapters has lot to offer for anyone who is new as well as for seasoned developer. The best chapter for me was on memorization and DP, I loved the vizual images used by Al on explaning few of recursive function calls. Its a must have book for any software engineer who is looking to build a very strong foundation on recursion and DP. And this book also can help to strengthen many general computer science concepts. I would highly recommend this book and would advice to code as you read the book and dont jump to the next chapter without practicing. Lastly, I just wish the publisher make a colored version of this book, I guess it would enhance the learning if we have the book in colored version (it really helps to reach the code snip-it and images)
Thank you for your feedback
Sorry, there was an error
Sorry we couldn't load the review

Top reviews from the United States

  • Reviewed in the United States on December 22, 2024
    Format: PaperbackVerified Purchase
    Many others have already said wonderful things about this book, and I wholeheartedly agree with them. As a Ph.D. in Applied Mathematics and Statistics, I find myself in an unusual position: despite the growing necessity of coding in modern research and experimentation, I simply don’t enjoy it. While I believe I have the capacity to code, it has never been something I truly liked. That’s why Al’s books have been a revelation for me. Al is a great educator. He has a talent of teaching programming in a way that resonates. It truly got me intrigued. I’ve purchased several of his books to show my gratitude.
    3 people found this helpful
    Report
  • Reviewed in the United States on January 30, 2026
    Format: Paperback
    The Recursive Book of Recursion teaches recursion in a clear, methodical way that actually helps you understand how it works, rather than just showing patterns to memorize. The explanations build gradually, making complex ideas feel approachable instead of abstract or intimidating.

    The Python and JavaScript examples are well designed and reinforce the underlying concepts, helping you develop the right mental model for recursive thinking. The exercises are meaningful and encourage real understanding, not trial-and-error coding.

    Overall, this is a well-structured, thoughtful book for anyone who wants to genuinely learn recursion and feel confident applying it in real code. Highly recommended for developers who want a deeper, clearer grasp of this topic.
    One person found this helpful
    Report
  • Reviewed in the United States on September 7, 2022
    Format: Kindle
    I encourage folks learning programming to first buy Al Sweigart’s book, “Automate the Boring Stuff with Python”. That book teaches you Python from the beginning and assumes no previous knowledge. The book used in conjunction with his video course on Udemy, similarly named “Automate the Boring Stuff with Python”, are a great way to start learning Python.

    His latest book, "The Recursive Book of Recursion", takes the reader into the more advanced subject of recursion. Topics include the concepts of the stack, pushing in and popping out of the stack, and stack overflow. Recursion is compared to iteration, and examples are shown where both approaches are shown and critiqued. Cases where recursion is advantageous are presented with illustrations to enhance one’s comprehension. While not a beginner’s book, it is a good read to fill in a sufficiently complex subject. Copious Python and JavaScript recursion code are provided. Some fun and cool demonstrations of recursion make use of turtle graphics. Going forward, this will be my ‘go-to’ reference for recursion. Thank you, Al Sweigart!

    Here’s a breakdown of what’s included (from the book):

    Introduction - Covers how to set up Python and JavaScript on your computer to follow along with the code examples in the rest 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 – Explore 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
    Finally, I would also recommend another one of his earlier books, “Cracking Codes with Python”. This is an excellent book on using Python to encrypt, decrypt, and cracking various encryption algorithms.
    5 people found this helpful
    Report
  • Reviewed in the United States on November 19, 2022
    Format: Paperback
    It may seem odd that a book devoted entirely to recursion would contain such statements as “You never need to use recursion. No programming problem requires recursion … In fact, a recursive function might be an overcomplicated solution…” Nevertheless, Al Sweigert goes on to explain the ins and outs of a programming technique you should rarely, if ever, need to use. And he does so masterfully.
     
    Recursion and recursive functions seem to many (including me) to be esoteric mysteries, understandable only to those elite few who are wired to think in a pretty unconventional way. We are taught from a young age that you can’t define a word by using that word, itself. To that idea, recursion says “watch me!”.
     
    In explaining recursion, Sweigert is careful to begin by laying important groundwork. With adequately (but not overly) detailed and approachable explanations and examples, he discusses functions, their operation and features. He spends significant time explaining the call stack, what it does, how it is structured, and how it operates, leading to a discussion of ‘stack overflow’, one of the risks of using recursion. With that out of the way, he then devotes an entire chapter to comparing recursion and iteration, demonstrating that in the vast majority of cases, recursive functions simply aren’t necessary and in some cases perform worse than their iterative counterparts.
     
    The ensuing chapters look at recursion in action, exploring several popular recursive algorithms and techniques. It is in these chapters where we begin to see where recursion is actually a good idea, where it is a good fit (and also where it is not). So, while recursion may be mostly unnecessary, it is absolutely tailor-made for certain functions. Among other things, Sweigert explores traversing tree structures and demonstrates how memoization (yes, I spelled that correctly) can improve the efficiency of some recursive functions. He provides a plethora of examples demonstrating each concept he explores. It is worth noting here that Sweigert provides code examples in both Python and JavaScript (where possible), making it a valuable resource for students of both. The book ends with several projects that build on the lessons that come before, including one that implements the very cool Droste Effect.
     
    For the beginning and intermediate programmer, which is the only demographic to which I can relate, the real value of this book lies not only in its teaching about recursion. Its value also stems from its ability to stretch you just a little bit further, to make think just a little bit differently, to give you confidence that maybe lofty concepts that seem way above your head are within reach. Any book that can achieve that while simultaneously telling you that what you’re learning is mostly unnecessary is well worth the read.

    --Reviewer was provided a review copy by the author
    11 people found this helpful
    Report

Top reviews from other countries

Translate all reviews to English
  • Smart Aleck
    5.0 out of 5 stars Çok güzel bir kitap.Tavsiye ederim.
    Reviewed in Turkey on February 7, 2024
    Format: PaperbackVerified Purchase
    Kitap bu konuda çok işime yaradı. Konu ile ilgililere şiddetle tavsiye ederim. Faydalı bir kitap akıcı ve anlaşılır. Pek çok şey öğreniyorsunuz. Tabi konu ile ilgili biriyseniz. Python ve Javascript programlama dillerinde intermediate seviyede birikiminiz olması gerektiğini önemle belirteyim. Intermediate seviyedeyseniz alın işe yarar. Baskısı gayet kaliteli ve rahat okunabilir punto büyüklüğü. Ucuza alacağım diye gidip fotokopi, fake kitaplara para vermeyin tavsiye etmem.
    Report
  • Ricardo D
    5.0 out of 5 stars To understand recursion, one must first understand recursion.
    Reviewed in Australia on May 7, 2023
    Format: PaperbackVerified Purchase
    This book does a good job of it...
  • Vladimir Nabokov
    5.0 out of 5 stars Good insight
    Reviewed in the United Kingdom on June 19, 2024
    Format: PaperbackVerified Purchase
    I bought this book as a companion to Elements of Programming Interviews in Python. Glad I did as it has helped my understanding of recursion a lot.
  • J. Bachmann
    5.0 out of 5 stars lesenswertes Buch
    Reviewed in Germany on November 5, 2025
    Format: PaperbackVerified Purchase
    Sehr gutes Buch, um Rekursion zu lernen wirklich lesenswert. Großartiger Autor.
  • Loki2018
    5.0 out of 5 stars Top
    Reviewed in Germany on February 14, 2023
    Format: KindleVerified Purchase
    Erfüllt seinen Zweck