CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Let T(n) be a function defined by the recurrence T(n) = 2T(n/2) + n for n 2 and T(1) = 1. Which of the following statement is TRUE?

A
T(n) = (n log n)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
T(n) = (n)
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
T(n) = n
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
T(n) = (log n)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B T(n) = (n)
T(n) = 2T(n/2) + n
By substitution method T(n) = (n).
T(n) = 2. T(n/2) + n ...(1)
= 2[2 . T(n/4) + n/2] + n
= 22 . T(n/22) + n(1 + 2) ...(2)
= 23 . T(n/23) + n(1 + 2 + 2) ...(3)

= 2k . T(n/2k) + n(k=1i=0) = (n)

flag
Suggest Corrections
thumbs-up
2
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
The Pinhole Camera
QUANTITATIVE APTITUDE
Watch in App
Join BYJU'S Learning Program
CrossIcon