Any computer scientists out there?
I'm current struggling with a concept that I hope you could help with.
I'm learning about recursion - calling a function from within the same function. I can see that this produces cleaner code vs iteration inside a function but I'm struggling to see the advantage.
Presumably recursion uses more memory than iteration as it has to work backwards through values in the stack. It certainly seems more complicated (to me at least) than iteration. So what is the advantage of this method? Is it faster? If so why?