What is advantages of using recursion functions | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is advantages of using recursion functions

18th Mar 2017, 1:56 PM
sai teja
sai teja - avatar
2 Answers
+ 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.
18th Mar 2017, 2:04 PM
Hatsy Rei
Hatsy Rei - avatar
+ 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.
18th Mar 2017, 2:07 PM
Tamás Barta
Tamás Barta - avatar