0 votes 0 votes Algorithms algorithms time-complexity gateforum-test-series + – Gupta731 asked Jan 2, 2019 retagged Jul 7, 2022 by Lakshman Bhaiya Gupta731 510 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Gupta731 commented Jan 2, 2019 reply Follow Share n,n/2,n/4.... Isn't this nlogn 0 votes 0 votes Abhisek Tiwari 4 commented Jan 2, 2019 reply Follow Share why are u adding n n/2,n/4,n/8 ,,,,,,,, how many iteration it take to reach from n to 1 i.e logn its like for(i=1;i<n;i=i*2) TC==?? logn 0 votes 0 votes Gupta731 commented Jan 2, 2019 reply Follow Share yes got it, thanks bro 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes j>>=1 means rightshift 1 n/2^j =1 n=2^j j=logn gorya506 answered Aug 18, 2019 gorya506 comment Share Follow See all 0 reply Please log in or register to add a comment.