GATE CS 2014, set 3 · Question 28 · Compiler Design · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Which of the following statements are CORRECT ?
1) Static allocation of all data areas by a compiler makes it impossible to implement recursion.
2) Automatic garbage collection is essential to implement recursion.
3) Dynamic allocation of activation records is essential to implement recursion.
4) Both heap and stack are essential to implement recursion.

  1. (A) 1 and 2 only
  2. (B) 2 and 3 only
  3. (C) 3 and 4 only
  4. (D) 1 and 3 only
Answer

Answer (D)

Answer from the official GATE CS 2014 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes