Explanation: both iterative and recursive approach can be implemented in log n time but the recursive code requires memory in call stack which makes it less preferable.
Q. What is the advantage of iterative code for finding power of number over recursive code?
β
Correct Answer: (B)
iterative code requires less space
Explanation by: Mr. Dubey
both iterative and recursive approach can be implemented in log n time but the recursive code requires memory in call stack which makes it less preferable.
Discussion
Question Analytics
915
Total Visits
3 y ago
Published
Mr. Dubey
Publisher
88%
Success Rate