Recursion Basics

Define a solution in terms of itself with a base case.

Lesson 4

Concept

A recursive function calls itself on smaller inputs until a base case. Ensure progress toward base and consider stack depth limits.

Try it

Recursive Thinking

Identify base case
Reduce problem
Call recursively
Combine results