26 26 votes Let $T(n)$ be the function defined by $T(1) =1, \: T(n) = 2T (\lfloor \frac{n}{2} \rfloor ) + \sqrt{n}$ for $n \geq 2$. Which of the following statements is true? $T(n) = O \sqrt{n}$ $T(n)=O(n)$ $T(n) = O (\log n)$ None of the above Algorithms gate1997 algorithms recurrence-relation normal + – Kathleen 10.5k views answer comment Share Follow Print See all 16 Comments 16 16 Comments reply Show 13 previous comments arpit.jha commented Sep 25, 2024 reply Follow flag @ankitgupta.1729 the height in your recurrsion tree it should be Log(n) I think not Log(n) +1, take n = 16 and trace the tree its height is 4 i.e. Log(16) 0 0 replyShare ankitgupta.1729 commented Sep 29, 2024 reply Follow flag @arpit.jha both log(n) and log(n)+1 are correct. You can take any one of them which you like.There is no single definition of height of a tree. 0 0 replyShare arpit.jha commented Sep 29, 2024 reply Follow flag ok sir 0 0 replyShare Please log in or register to add a comment.
Best answer 50 50 votes Answer is $B$. using master method (case $1$) where $a = 2, b = 2$ $O(\sqrt{n}) < O(n^ {log_b a})$ $O(\sqrt{n}) < O(n^{log_2 2})$ $O(\sqrt{n}) < O(n^1)$ ankitrokdeonsns answered Oct 12, 2014 • edited Nov 16, 2025 by Umesh Shelke ankitrokdeonsns comment Share Follow See all 4 Comments 4 4 Comments reply `JEET commented Jan 2, 2020 reply Follow flag Here $\mathrm{k \ngeq 0}$, then how you applied Master's theorem? 0 0 replyShare `JEET commented Jan 2, 2020 reply Follow flag @Satbir Do you think this selected answer even correct? 0 0 replyShare Satbir commented Jan 2, 2020 reply Follow flag k is 0.5 5 5 replyShare `JEET commented Jan 2, 2020 reply Follow flag Ohh..that was a foolish mistake. Thanks. 1 1 replyShare Please log in or register to add a comment.
1 1 vote n^(log2 2)=n f(n)=√n n^(log2 2) is polynomially greater then f(n) Extended Master's theorm CASE 1: f(n)=O(n^(logb a)-e) e>0,then T(n)=Θ(n^logb a) T(n)=Θ(n) Option B ashishtomarx answered May 7, 2024 ashishtomarx comment Share Follow See 1 comment 1 1 comment reply ꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂ commented Jun 7, 2024 reply Follow flag @theradash u can use $fx$ for functions to make ur ans good use latex equations 0 0 replyShare Please log in or register to add a comment.