GATE 2014 [Set-3]
April 4, 2025GATE 2013
April 5, 2025GATE 2014 [Set-3]
Question 28 |
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 and 2 only | |
2 and 3 only | |
3 and 4 only | |
1 and 3 only |
Question 28 Explanation:
The statement, static allocation of all data areas by a compiler makes it impossible to implement recursion is true, as recursion requires memory allocation at run time, so it requires dynamic allocation of memory. Hence, Dynamic allocation of activation records is essential to implement recursion is also a true statement.
Correct Answer: D
Question 28 Explanation:
The statement, static allocation of all data areas by a compiler makes it impossible to implement recursion is true, as recursion requires memory allocation at run time, so it requires dynamic allocation of memory. Hence, Dynamic allocation of activation records is essential to implement recursion is also a true statement.