Q. State one advantage and one disadvantage of using recursion over iteration.


Answer =

Advantage:
Recursion makes the code short and simple while iteration makes the code comparatively longer.

Disadvantage:
Recursion is slower than iteration due to overhead of multiple function calls and maintaining a stack for it.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post