2 votes 2 votes explain complexity for this Algorithms algorithms master-theorem time-complexity + – set2018 asked Aug 17, 2017 set2018 4.1k views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply joshi_nitish commented Aug 17, 2017 reply Follow Share it will be O(n) , n(2-cosn)= O(n) 1 votes 1 votes set2018 commented Aug 17, 2017 reply Follow Share see point number 22 0 votes 0 votes set2018 commented Aug 17, 2017 reply Follow Share http://www.csd.uwo.ca/~moreno//CS424/Ressources/master.pdf 4 votes 4 votes set2018 commented Aug 17, 2017 reply Follow Share @Bikram sir 0 votes 0 votes Please log in or register to add a comment.
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. Aghori answered Aug 17, 2017 Aghori comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments BHAVESH d shah commented Sep 3, 2017 reply Follow Share T (n) = T (n/2) + n(2 − cos n) =⇒ Does not apply. We are in Case 3, but the regularity condition is violated. (Consider n = 2πk, where k is odd and arbitrarily large. For any such choice of n, you can show that c ≥ 3/2, thereby violating the regularity condition.) 1 votes 1 votes debasree88 commented Apr 25, 2019 reply Follow Share Can someone explain me this example? I read that pdf too...but couldn't understand this example....pls pls pls 0 votes 0 votes Gaganjot _Kaur commented Nov 21, 2019 reply Follow Share @debasree88 Have a look at my solution. Hope it helps. Pardon for bad handwriting. 1 votes 1 votes Please log in or register to add a comment.