Today, we are learning about an algorithmic concept called recursion. Check out the Tutorial tab for learning materials and an instructional video.
Recursive Method for Calculating Factorial
Complete the factorial function in the editor below. Be sure to use recursion.
factorial has the following paramter:
- int n: an integer
- int: the factorial of
Note: If you fail to use recursion or fail to name your recursive function factorial or Factorial, you will get a score of .
A single integer, (the argument to pass to factorial).
- Your submission must contain a recursive function named factorial.
Consider the following steps. After the recursive calls from step 1 to 3, results are accumulated from step 3 to 1.