

InterviewSolution
Saved Bookmarks
1. |
State one advantage and one disadvantage of using recursion over iteration. |
Answer» In iteration, the statement is executed repeatedly using the same memory space which is allocated once. In recursion, the statement is executed repeatedly by invoking the same function within itself and for each recursive call, a fresh memory is allocated. The recursive function runs slower as compared to iteration. |
|