2,333 views
0 votes
0 votes
Let R represents class of Recursive Programs and I denotes class of Iterative Program. Which of them is incorrect ?

A. Some Program belonging to R doesn't Terminate.

B. For every Program in I there is a equivalent recursive program in R.

C. Every Program in R uses strictly more stack space compared to its equivalent program in I

D. None

Ans. C

Please log in or register to answer this question.

Related questions

1 votes
1 votes
3 answers
3
jverma asked May 23, 2022
1,069 views
#include <stdio.h>int f(int n){ static int r = 0; if (n <= 0) return 1; r=n; return f(n-1) + r;}int main() { printf("output is %d", f(5)); return 0;}Ou...
5 votes
5 votes
1 answer
4
srestha asked Aug 6, 2018
586 views
How will this function run for the input 123 (where str points '123' and n=3)?in myAtoiRec(int *str,int n) { if(n==1) return*str-'0'; return(10*myAtoiRec(str,n-1)+str[n-1...