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.





Solution
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 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Exam Quiz Website development Company in Allahabad