Recursion usage | Sololearn: Learn to code for FREE!
+ 5

Recursion usage

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

5th Apr 2017, 1:30 AM
5 Answers
+ 11
Because recursion may sometimes be able to simplify tasks which can only be completed by utilising complicated loops, if done via iteration.
5th Apr 2017, 2:10 AM
Hatsy Rei
Hatsy Rei - avatar
+ 6
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.
5th Apr 2017, 2:25 AM
Rrestoring faith
Rrestoring faith - avatar
+ 2
ok thanks that makes sense
5th Apr 2017, 2:13 AM
+ 2
thanks man i will look at that
5th Apr 2017, 2:22 AM
Recursion for me is just on point and easy to use
25th Jul 2017, 2:03 PM
Glen Mudau
Glen Mudau - avatar