GATE CS 2004 · Asymptotic Analysis & Recurrences

MCQ · 1 mark · Problem PROG-DIVC-0152

The Asymptotic Notation of the following C function is (assume n \(\gt\) 0) int recursive (int n) {
   if (n == 1)
      return (1);
   else
      return (recursive (n - 1) + recursive (n - 1));
}
  1. A
    O(\((n^{2})\))
  2. B
    O(nlog n)
  3. C
    O(n)
  4. D
    O(\((2^{n})\))

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option D.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1077/gate2004-83-isro2015-40

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com