Recursion questions — page 2 of 2

Q42

GATE CS 2014 CS-2RecursionMCQ2 marks−2/3 if wrong
Consider the C function given below.
int f(int j)
{
  static int i = 50;
  int k;
  if (i == j)
     {
       printf("something");
       k = f(i);
       return 0;
     }
  else return 0;
}
Which one of the following is TRUE?
Show answer without attempting

Answer: D

Q16

GATE CS 2012 CSRecursionMCQ1 mark−1/3 if wrong
The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with nn discs is
Show answer without attempting

Answer: D

0/20 correct0 marks

Related topics in Programming and Data Structures