Test Your Knowledge (Ch 12)
The following questions are based on what we have learned so far in Chapter 12 – Recursion in C. To test your understanding, try answering the following questions. The explanations are also provided to each question so you can always check the correctness of your answers. All the best 👍
Question 2
Which of the following is true about recursion?
Recursion always uses less memory than iteration.
Tail recursion can be optimized to be as efficient as iteration.
Indirect recursion is faster than direct recursion.
Recursive solutions always have a base case.
explanation
Tail recursion can be optimized by compilers through tail call optimization, making it as efficient as the iteration.
Leave a comment