Recursion usage | Sololearn: Learn to code for FREE!


Recursion usage

if recursion is supposedly more resource intensive than regular looping, what is the point of using/learning about recursion?

4/5/2017 1:30:47 AM


5 Answers

New Answer


Because recursion may sometimes be able to simplify tasks which can only be completed by utilising complicated loops, if done via iteration.


It depends on what the loop is doing. I like recursion cause it keeps things tidy, in a small and precise line of code. I suggest you take a look at functions that are not primitive recursive such as ackermann's function.


ok thanks that makes sense


thanks man i will look at that


Recursion for me is just on point and easy to use