In a recursive function, what is the base case?

The simple case solved directly, without calling itself again, so the recursion stops.

Start playing free

  1. The first line of the function
  2. The case answered without another recursive call ✔
  3. The biggest input it can handle

Why: A recursive function solves a big problem by calling itself on a smaller one. The base case, like a list of one item already being sorted, is where it stops shrinking and just answers.

Huh, didn't know that: Merge sort's base case is a list of one item, which is already sorted by definition.

The dad joke
To understand recursion, you must first understand recursion.
Like this card?
Play the game

References

Answer: The case answered without another recursive call. A recursive function solves a big problem by calling itself on a smaller one. The base case, like a list of one item already being sorted, is where it stops shrinking and just answers.

  1. MIT 6.006 Introduction to Algorithms, Lecture 3: Sorting ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/resources/mit6_006s20_lec3
    Base case: for n = 1, array has one element so is sorted
    Checked 2026-10-10.

Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.

Test yourself in the game