• retagged by
1,932 views
2 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

1 Answer

2 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:
Position:
Show:

Related questions

0 0 votes
0 0 answers
446
446 views
aniketpatil32 asked May 11, 2019
446 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 3 votes
2 2 answers
1.3k
1.3k views
Atul Verma12 asked Dec 13, 2016
1,294 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)$Why...
4 4 votes
7 7 answers
12.2k
12.2k views
Anil Khatri asked Aug 31, 2016
12,159 views
Determine theta bound for recurrence :$$T(n)=T(n/2)+T(n/4)+T(n/8)+n$$
0 0 votes
1 answers 1 answer
1.0k
1.0k views
Geet asked Oct 23, 2016
1,030 views
Find the recurrence relation for the number of binary strings not containing two consecutive zeros or two consecutive ones.