+ 1
What is advantages of using recursion functions
2 ответов
+ 16
A substitution to iteration when the latter is too complex, or to make the code shorter when the similar solution needs to be applied.
However, recursive function logics can be difficult to trace. Most of the times, iteration is encouraged.
+ 5
There are problems which can be solved easier using recursion. In this case you use recursion to solve a harder/bigger problem by splitting it to easier/smaller ones and you solve them using the same recursive function and combine results to solve the biggest one.