GATE : Computer Science and IT

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.

,

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.

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.

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.


A. 1 and 2 only

B. 2 and 3 only

C. 3 and 4 only

D. 1 and 3 only



Correct Answer :

D. 1 and 3 only



Explanation
To implement recursion, activation record should be implemented by providing dynamic memory allocation. This dynamic allocation is done from runtime stack. Heap is essential to allocate memory for data structures at run-time, not for recursion. So, statement 1 and 3 are correction.
CCC Online Test , CCC MCQ Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz career counselling in allahabad Website development Company in Allahabad