Is Iterative Approach Advanatgous over Recursion

When should recursion be used and when Iterative

@PoojaSingh22,

Is the recursive version usually faster? No – it’s usually slower (due to the overhead of maintaining the stack)

Does the recursive version usually use less memory? No – it usually uses more memory (for the stack).

Then why use recursion?? Sometimes it is much simpler to write the recursive version

Binary tree traversals are a good illustration of something that’s very easy to implement recursively.

Unless you can reduce the complexity using recursion then only use recursion otherwise stick to iterations