1 votes 1 votes T(n)=T(n/2)+2; T(1)=1 when n is power of 2 the correct expression for T(n) is: a) 2(logn+1) b) 2logn c)logn+1 d)2logn+1 Algorithms recurrence-relation algorithms time-complexity jest + – sripo asked Nov 14, 2018 sripo 1.6k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Hemanth_13 commented Nov 14, 2018 reply Follow Share Option D 0 votes 0 votes sakharam commented Nov 14, 2018 reply Follow Share T(n)=T(n/2)+2 T(n/2)=T(n/4)+2 T(n/4)=T(n/8)+2 T(n)=T(n/8)+2+2+2 T(n)=T(n/(23)) +3*2 T(n)=T(n/(2k)) +k*2 Let 2k=n i.e k=lg n T(n)=T(n/(2lg n)) +lg n *2 T(n)=T(1)+ 2* lg n Since T(1)=1 T(n)= 2*log2n +1 5 votes 5 votes soubhik baral commented Nov 14, 2018 reply Follow Share option d with elimination method. 1 votes 1 votes Please log in or register to add a comment.
3 votes 3 votes let n be 2k T(2k )=T(2k-1 )+2 put k=1 to get T(1)=1 T(2)=T(1)+2 T(2)=3 as T(1)=1 put n value as 2 in option D 2log2+1=3 Hence verified it will not satisfy any other option sripo answered Nov 14, 2018 sripo comment Share Follow See all 0 reply Please log in or register to add a comment.