InterviewSolution
Saved Bookmarks
| 1. |
Which of the following statements is true?(a) Recursion is always better than iteration(b) Recursion uses more memory compared to iteration(c) Recursion uses less memory compared to iteration(d) Iteration is always better and simpler than recursionThe question was posed to me by my college director while I was bunking the class.This interesting question is from Recursion in division Recursion of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (B) Recursion uses more memory compared to iteration To explain: Recursion uses more memory compared to iteration because EVERY time the RECURSIVE function is called, the function call is stored in STACK. |
|