Which is best
Recursion or iteration
never use recursion in interview if you know iterative code, recursion increases space and time complexity in most of the situations
Jenis Gadhiya reason?
Iteration is a much better option...
Obviously the execution of iteration is much faster than recursion.. Bcoz during recursion stack is made and during the execution of iteration no such structure is made.. Which speedens the execution of the program..
Overall recursion is best?
I think it's depends about what's the way that the code will be write, both of them have some advantages, but I prefer iteration because I'm not understand well functional programming yet, soon I will
It all depend upon situation. But prefer to use recursion
Depends on the problem, you can solve something only with recursion and not with iteration.