Question discussion

What is the solution of the recurrence T(n) = 3T(n/2) + n ?

986Medium DSSSB TGT Computer Science 0 replies

What is the solution of the recurrence T(n) = 3T(n/2) + n ?

  • AΘ(n log n)
  • BΘ(n^(log₂3))
  • CΘ(n²)
  • DΘ(n)
Correct answer: B

Explanation

Here a = 3, b = 2 so n^(log₂3) ≈ n^1.58 dominates f(n) = n, and case 1 of the Master theorem gives Θ(n^(log₂3)).

Discussion 0

Nobody has replied yet. Start the discussion!