Deprecated: Implicit conversion from float-string "1530167763.831" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1530167763.831" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1530167763.831" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1530167763.831" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1530167763.831" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1547957779.702" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1547957779.702" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1547957779.702" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1547957779.702" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1547957779.702" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1577258796.212" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1577258796.212" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1577258796.212" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1577258796.212" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1577258796.212" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1672210260.570" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1672210260.570" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1672210260.570" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1672210260.570" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1672210260.570" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1592920969.940" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1592920969.940" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1592920969.940" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1592920969.940" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1592920969.940" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1598117428.923" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1598117428.923" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1598117428.923" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1598117428.923" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1598117428.923" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1666535202.418" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1666535202.418" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1666535202.418" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1666535202.418" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1666535202.418" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1553838837.487" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1553838837.487" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1553838837.487" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1553838837.487" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1553838837.487" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1569167055.768" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1569167055.768" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1569167055.768" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1569167055.768" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1569167055.768" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594
Compiler Design: GATE CSE 2014 Set 3 | Question: 18
edited by
13,063 views
49 votes
49 votes

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. $1$ and $2$ only
  2. $2$ and $3$ only
  3. $3$ and $4$ only
  4. $1$ and $3$ only
edited by

3 Answers

Best answer
42 votes
42 votes

It will be D.

option $2$ is wrong because it is not necessary to have automatic garbage collection to implement recursion.

option $4$ is wrong because it says that both are required to implement recursion, which is wrong. Either of them will suffice.

edited by
24 votes
24 votes

1) In Static allocation of memory , we cannot implement recursion. As in recursion we cannot determine at first how many time function will be called

2)Automatic garbage collection done in JAVA (JVM done this) and LISP. But recursion we can implement in C too.So, Automatic Garbage Collection is not essential for Recursion

3) True. Same reason as 1)

4)Stack implement recursion, but heap is not necessary for recursion

2 votes
2 votes

This question can be solved by option elimination.

See the 4 th statement, it says both stack and heap are essential to implement recursion. But we know that only stack is enough to implement recursion. Hence 4 th statement is false.

 

Similarly statement 2 says automatic  garbage collection is essential for recursion which is again false as there is no relationship of automatic garbage collection and recursion. 

So statement 4 and 2 are false. 

Hence we are left with only as the correct answer.

 

 

Answer:

Related questions

34.8k
views
4 answers
67 votes
go_editor asked Sep 28, 2014
34,764 views
Consider the basic block given below. a = b + c c = a + d d = b + c e = d - b a = e + b The minimum number of nodes and edges present in the DAG representation of the abo...
19.2k
views
7 answers
60 votes
go_editor asked Sep 28, 2014
19,229 views
The minimum number of arithmetic operations required to evaluate the polynomial $P(X) = X^5+4X^3+6X+5$ for a given value of $X$, using only one temporary variable is ____...
9.2k
views
4 answers
29 votes
go_editor asked Sep 28, 2014
9,226 views
Which one of the following is NOT performed during compilation?Dynamic memory allocationType checkingSymbol table managementInline expansion
9.1k
views
4 answers
35 votes
go_editor asked Sep 28, 2014
9,112 views
One of the purposes of using intermediate code in compilers is tomake parsing and semantic analysis simpler.improve error recovery and error reporting.increase the chance...