Courses that adapt to how you think.

Built around mastery, not minutes.

Question 1
24

What is the base case in factorial(n)?

Awaiting answer

Lessons

On this page
  • 01Base cases
  • 02Recursive case
  • 03Common mistakes
  • 04Worked examples
Recursive case

In recursion, we always need a base case so the function doesn't call itself forever. For factorial, that case is n == 0.

Mastery, measured.