Skip to content
Quiz · Algorithms and Complexity · lesson 6 of 9

Quiz — the base case of recursion

Which line, added at the top of factorial, makes factorial(3) return 6?

C++
int factorial(int n) {
    return n * factorial(n - 1);
}

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way