Given the recurrence relation for the worst-case time complexity • T(n) = c,…

2025

Given the recurrence relation for the worst-case time complexity

• T(n) = c, when n = 1

• T(n) = T(n/2) + c, otherwise

Where c is a constant the recurrences solves to :

T(n) = c[1 + log2n]

What is the worst-case time complexity of this algorithm ?

Answer: B. Θ(log n)

  1. A.

    Θ(n)

  2. B.

    Θ(log n)

  3. C.

    Θ(n log n)

  4. D.

    Θ(1)

Attempted by 113 students.

Show answer & explanation

Correct answer: B

Explore the full course: Mppsc Assistant Professor Computer Science Paper 2

Loading lesson…