0
how to find a factorial of a number?
5 Answers
+ 6
https://code.sololearn.com/cjaInE3bgRqx/?ref=app
+ 1
Hi,
Recursion, however, is costly in terms of efficiency. It's basically a function call, which in itself is expensive compared to looping.
It involves complex push and pop operations on the stack.
A loop on the other hand is much more efficient as it doesn't involve as much overhead.
so avoid recursive function.
if I am wrong pls correct me.