GATE CS 2009 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0119

The running time of an algorithm is represented by the following recurrence relation:\[T(n)=\left\{\begin{matrix} n & n\leq 3\\ T(\frac{n}{3})+cn& otherwise \end{matrix}\right.\]Which one of the following represents the time complexity of the algorithm?
  1. A
    \(\theta\)(n)
  2. B
    \(\theta\)(n log n)
  3. C
    \(\theta (n^{2})\)
  4. D
    \(\theta (n^{2} logn)\)

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

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1321/gate2009-35

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