Computer scienceFundamentalsEssentialsProgramming conceptsIntro to programming

Recursion basics

The factorial

Report a typo

You are trying to explain recursion to your friend and tell them about a factorial of a positive integer. You are writing the following:

factorial (X) :

  • If X is 1, factorial is 1.
  • If X is not 1, see: factorial(X1)X.factorial(X-1) * X.

Is the algorithm correct?

Select one option from the list
___

Create a free account to access the full topic