Skip to main content

๐ŸŽฎ Recursion (Practice)

Companion to the Recursion & The Call Stack guide. Practice recursion and see memoization collapse exponential work. Edit and run the code right here โ€” it executes in your browser.

๐Ÿ Your turnโ€‹

Loading editorโ€ฆ

๐Ÿง  Challenge yourselfโ€‹

  1. Count calls for fib_fast โ€” why is it O(n)?
  2. Write recursive factorial, then convert to iterative.
  3. What causes a RecursionError, and how does tail-call style help?

Continue the learning path โ†’ Python Internals Numpy Memory