Ticker

6/recent/ticker-posts

GATE|GATE-CS-2014 PAPER-03|Question-3

 

GATE|GATE-CS-2014 PAPER-03|Question-3

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.

Answer (D)

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 correction.

Post a Comment

0 Comments