Write a program to calculate Factorial of a number using recursive function. To improve the performance, try to use HashMap, which will store the calculated factorials that can be reused.
FYI, Factorial of n is the product of all positive descending integers. Factorial of n is denoted by n!.
e.g:
3!=3*2*1=6
4!=4*3*2*1=24
5!=5*4*3*2*1=120
-K Himaanshu Shuklaa..
FYI, Factorial of n is the product of all positive descending integers. Factorial of n is denoted by n!.
e.g:
3!=3*2*1=6
4!=4*3*2*1=24
5!=5*4*3*2*1=120
-K Himaanshu Shuklaa..
No comments:
Post a Comment