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

Consider the reccurence function
T(n) = { 2T(n) + 1, n > 2
2, 0 < n 2
Then T(n) in terms of notation is

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

The correct option is B Θ(n)
T(n) = 2T (n) + 1 ... (1)
T(n) = 2T (2n) +1 ..... (2)
Substituting (2) in (1)
T(n) = 2.2T(2n) + 2
T(n) = 22T (2n) + 2 ..... (3)
T(2n) = 2T (3n) + 1 ...... (4)
Substituting (4) in (3)
T(n) = 23T (3n) + 3
Running the same till K times.
T(n) = 2K T(Kn) + K
Kn = 2
K = log2 n
Solving this will give
T(n) = Θ(log n)

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Integration of Irrational Algebraic Fractions - 1
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon