Memorizing factorials

Report a typo

Below is an algorithm for finding the factorial of an integer number using recursion:

function fact(n):
    if (n==1):
        return 1

    return n*fact(n - 1)

Can you rewrite the algorithm using memoization to improve performance? Let's assume we are calling the function only once.

Select one option from the list
___

Create a free account to access the full topic