Q. If any recursive function can be easily written using iterative code, then what is the need for recursion? When would you prefer recursion over iteration and vice versa?

 
 

Answer =

 

Recursion makes the program sorter and simple.

 

Recursion preferred over iteration when we have to understand program easily and to make program sorter.

 

Iteration preferred over recursion when we have required less memory space.

2 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post