4,097 views
2 votes
2 votes

explain complexity for this 

1 Answer

0 votes
0 votes
See the value of $\cos(n)$ will oscillate between $-1$ or $1$ thus makes $f(n)$ between $n$ & $3n$. In both of the cases, complexity turns out to be $\theta(n)$ only.

Related questions

1 votes
1 votes
1 answer
1
2 votes
2 votes
1 answer
2
iarnav asked Jan 11, 2018
1,114 views
can we solve this T(n) = T(n/2) + 1 using master theorem?
3 votes
3 votes
0 answers
3
Sona Barman asked Jan 8, 2018
2,318 views
I have doubt regarding Master theorem.In which situation we should use Normal Master theorem/extended Master theorem?
1 votes
1 votes
1 answer
4
dragonball asked Dec 19, 2017
572 views
T(n) = 2T(n/2) + nlogna. O(nlogn)b.n(log^2n)c.O(n^2)