in Algorithms edited by
4,851 views
21 votes
21 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?

  1. $T(n) = O \sqrt{n}$

  2. $T(n)=O(n)$

  3. $T(n) = O (\log n)$

  4. None of the above

in Algorithms edited by
4.9k views

4 Comments

@ankitgupta.1729

@srestha

using floor or ceil make any difference in big O notation?

Asking not for this question but in general scenario does floor or ceil make any change in overall complexity?

 

0
0

@jlimbasiya  

No.

0
0

@ankitgupta.1729

You resolved all my doubts on solving the method by recursion tree method. Earlier I also think that cost of each level is same but when i tried to solve some question by taking this, few questions Iā€™m not able to solve but now i understand what is the reason behind it...šŸ˜Š

 

2
2

1 Answer

38 votes
38 votes
Best answer

Answer is $B$.

using master method (case 1)

where a = 2, b = 2

O(n1/2) < O(nlogba)

O(n1/2) < O(nlog22)

edited by

4 Comments

Here $\mathrm{k \ngeq 0}$, then how you applied Master's theorem?
0
0

@Satbir

Do you think this selected answer even correct?

0
0
k is 0.5
4
4
Ohh..that was a foolish mistake.

Thanks.
0
0
Answer:

Related questions