edited by
358 views

1 Answer

0 votes
0 votes

T(n)=aT(n-b)+O(nk)

if a=1 then T(n)=Θ(nk+1)

if a<1 then T(n)=O(nk)

if a>1 then T(n)=O(nkan/b)


1) a=1 so its Θ(n2) albeit this recurrence relation is quite simple and can be solve easily.

2) apply master theorem ,

nlogba =nlog3  = ~n1.x   and we know logn < n0.x

so in that way its TC = nlog3

3) Its O(n).

Related questions

1 votes
1 votes
1 answer
1
sripo asked Nov 14, 2018
1,608 views
T(n)=T(n/2)+2; T(1)=1when n is power of 2 the correct expression for T(n) is:a) 2(logn+1)b) 2lognc)logn+1d)2logn+1
0 votes
0 votes
3 answers
3
0 votes
0 votes
1 answer
4
shashi111 asked Aug 27, 2017
523 views
Consider the following recurrence.T(n) = T() + What is the value of recurrence?please explain in detail