By the Master Theorem, what is the solution of T(n) = 2T(n/2) + n?
-
A
Θ(log n)
-
B
Θ(n)
-
C
Θ(n log n)
Correct answer
-
D
Θ(n²)
Correct answer
C. Θ(n log n)
19 views
Explanation
Here a = 2, b = 2 and f(n) = n = n^(log₂2), which is case 2, so T(n) = Θ(n log n). This is merge sort's recurrence.
Reference
Asked in: GATE CS, Technical Interviews
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ