Algorithms and Data Structures

Lesson 06 · 15 min

Recursion: a function that calls itself

Base case, the call stack and a first look at memoization.

15 minLesson 6 of 8Practice includedAsk AI on any point

Recursion is when a function solves a problem by calling itself on a smaller version of the same problem. The sum of an array is the first element plus the sum of the rest. The factorial of n is n times the factorial of the previous number. Each call takes a step toward the simplest case, which no longer needs to be split.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.