3 ms·
Sound like your definition of recursion fits any loop. I doubt that's what recursion means in CS.
by rimantas 16y ago
Sound like your definition of recursion fits any loop.
I doubt that's what recursion means in CS.
- athom 16y agoThis is why most looping structurues can be replaced with recursion. It's also why you hear of "unrolling" tail-recursive calls into more traditional looping structures. They're equivalent.
- merijnv 16y agoThat would be because recursion and loops are isomorphic. Anything you can do with recursion can be done in a loop and vice versa. It's just that one or the other may be clearer or easier depending on what you're doing.