The running time of an algorithm is represented by the following recurrence…

GATE · 2009 · CS

The running time of an algorithm is represented by the following recurrence relation:

T(n) = n, if n ≤ 3; T(n) = T(n/3) + cn, otherwise.

Which one of the following represents the time complexity of the algorithm?

  1. A.

    Θ(n)

  2. B.

    Θ(n log n)

  3. C.

    Θ(n²)

  4. D.

    Θ(n² log n)

Attempted by 283 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…