GATE 2008 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2008

185 questions

MCQ 1851-mark 52 · 2-mark 133

Questions 101–105 of 185

Q101Asymptotic Notation1 markMCQ−0.33 if wrong
Arrange the following functions in increasing asymptotic order:
a. n1/3n^{1/3}
b. ene^n
c. n7/4n^{7/4}
d. nlog⁡9nn \log^9n
e. 1.0000001n1.0000001^n

Q102Asymptotic Notation2 marksMCQ−0.67 if wrong
Consider the following C functions:
int f1(int n)
{
  if(n == 0 || n == 1)
    return n;
  else
    return (2*f1(n-1) + 3*f1(n-2));
}
 
int f2(int n)
{
  int i;
  int X[N], Y[N], Z[N] ;
  X[0] = Y[0] = Z[0] = 0;
  X[1] = 1; Y[1] = 2; Z[1] = 3;
  for(i = 2; i <= n; i++)
  {
    X[i] = Y[i-1] + Z[i-2];
    Y[i] = 2*X[i];
    Z[i] = 3*X[i];
  }
  return X[n] ;
}
The running time of f1(n) and f2(n) are

Q103Asymptotic Notation2 marksMCQ−0.67 if wrong
Consider the following functions:
f(n)=2nf(n)=2^{n}
g(n)=n!g(n)=n!
h(n)=nlognh(n)=n^{log n}

Which of the following statements about the asymptotic behaviour of f(n), g(n), and h(n) is true?

Q104Recurrence Relation2 marksMCQ−0.67 if wrong
When n=22kn=2^{2 k} for some k⩾0k \geqslant 0, the recurrence relation T(n)=2T(n/2)+n,T(1)=1T(n)=\sqrt{2} T(n / 2)+\sqrt{n}, T(1)=1
evaluates to :

Q105Recurrence Relation2 marksMCQ−0.67 if wrong
Let xnx_{n} denote the number of binary strings of length n that contain no consecutive 0s.

The value of x5x_{5} is