0 votes 0 votes Find T.C T(n)=T(n-1)+1/n; t(n)=constant ifn<=2; Algorithms algorithms time-complexity cormen recurrence-relation + – Shashank Kumar Mishr asked Mar 7, 2017 • retagged Jul 9, 2022 by Lakshman Bhaiya Shashank Kumar Mishr 380 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply Akriti sood commented Mar 7, 2017 reply Follow Share log n?? 0 votes 0 votes Shashank Kumar Mishr commented Mar 7, 2017 reply Follow Share how to get it?please elaborate the xplanation? 0 votes 0 votes Akriti sood commented Mar 7, 2017 reply Follow Share @shashank,you can see it below. substitution method:) 0 votes 0 votes Shashank Kumar Mishr commented Mar 7, 2017 reply Follow Share got bro 0 votes 0 votes Please log in or register to add a comment.
Best answer 1 votes 1 votes T(n)=T(n-1)+1/n =T(n-2)+1/(n-1)+1/n =T(n-3)+1/(n-2)+1/(n-1)+1/n =T(n-4)+1/(n-3)+1/(n-2)+1/(n-1)+1/n =1+1/2+1/3+1/4+.....+1/(n-3)+1/(n-2)+1/(n-1)+1/n=logn(approx.)=⊝(logn) https://gateoverflow.in/118283/gate2017-2-38 jatin saini answered Mar 7, 2017 • selected Mar 7, 2017 by Shashank Kumar Mishr jatin saini comment Share Follow See all 0 reply Please log in or register to add a comment.