retagged by
968 views
2 votes
2 votes
Given below are some recurrence relation and some asymptotic complexities -

listA                                                                    listB

A) T(n) = T(n-1) + 1/n                                 1) Big theta(n log log n)

B) T(n) = 2T(n/2) + n/logn                          2) Big theta (n^2.5)

C) T(n) = sqr root (n).T(sqr root (n)) + n    3) Big theta(log log n)

D) T(n) = 4T(n/2) + n^2(sqr root(2))          4) Big theta(log n)

Codes :

    A  B C D

a) 4  1  2  3

b) 4  1  1  2

c) 1  4  3  2

d) 3  1  1  2

Correct ans  = b
retagged by

1 Answer

2 votes
2 votes
Option B is the answer.

1. T(n) = T(n-1) + 1/n
Apply substitution ,
T(n) = 1+1/2 + 1/3 + 1/4 +1/5 +... +1/n

T(n) = O(logn)

2.  T(n) = 2T(n/2) + n/logn

Apply master theorem
T(n)= O(nloglogn)

3.T(n) = sqr root (n).T(sqr root (n)) + n

T(n)= O(nloglogn)

4.T(n) = 4T(n/2) + n^2(sqr root(2))  

Apply master theorem
T(n)= O(n^2.5)
Answer:

Related questions

0 votes
0 votes
0 answers
1
aniketpatil32 asked May 11, 2019
219 views
T(n)=T(√n) + n I am finding it difficult to solve last step of this recurrence relation . Please help me with expansion of this recurrence relation.
3 votes
3 votes
2 answers
2
Atul Verma12 asked Dec 13, 2016
813 views
solve the recurrence relation:$T(n)=T(\sqrt{n})+\Theta (\log \log n)$My first step was to let $m=\log ⁡n$, making the above:$T(2^m)=T(2^{\frac{m}{2}})+\Theta (\log m)$W...
4 votes
4 votes
7 answers
3
Anil Khatri asked Aug 31, 2016
8,895 views
Determine theta bound for recurrence :$$T(n)=T(n/2)+T(n/4)+T(n/8)+n$$
0 votes
0 votes
1 answer
4
Geet asked Oct 23, 2016
713 views
Find the recurrence relation for the number of binary strings not containing two consecutive zeros or two consecutive ones.