edited by
401 views
0 votes
0 votes
If k is a positive constant, then the following divide and conquer recurrence evaluates to?

T(n) = k ; n=1

T(n) = 3 T (n/2) + kn ;n>1

a)T(n)= 3kn2-kn

b)T(n)=3kn log23  - 2kn

c)T(n)=3knlog23 - kn

d)T(n)=3kn2-2knlog23
edited by

1 Answer

0 votes
0 votes

since , T(1)=K (given)

T(2)=3T(1)+2K=5K

T(4)=3T(2)+4k=19K ....  SO...on

putting these values in option 2...

T(1)= 3k nlog23 - 2kn (since nlog23 == 3log2n== 1)

   =3*k*1 - 2k*1 == k

similarly,

T(2)= 3klog23 - 2kn ( 3log2n == 3)

       = 3*k*3 - 2*k*2 = 5k

and so..on . so answer is B

Related questions

1 votes
1 votes
1 answer
1
lalitver10 asked Jan 4, 2022
609 views
T(n)=T(n/5)+T(7n/10)+ana: constantwhat will be the time complexity of the above recurrence relation??Please share the approach for this kind of recurrence relation
0 votes
0 votes
3 answers
2
aditi19 asked Oct 6, 2018
1,143 views
what is the recurrence relation for merge sort?
1 votes
1 votes
1 answer
3
meethunjadhav asked Jul 30, 2018
432 views
suppose merge sort takes 2 sec to sort a set of 64 keys then how much time will take to sort a set of 512 keys?here, ans is 24 sec how it is plz explain me.
1 votes
1 votes
1 answer
4
VIKRAM KASANA asked Dec 21, 2017
656 views
please help me to understand