Discussion
Let T(n) be the function defined by T(n) = 1 and \(T(n) = 2T(n/2) + \sqrt{n}\), which of the following is TRUE ?
Answer: C
For \(T(n) = 2T(n/2) + \sqrt{n}\) the master theorem applies with a = 2, b = 2 and \(f(n) = n^{1/2}\). Since \(n^{\log_b a} = n\) and \(f(n) = O(n^{1-\epsilon})\) with \(\epsilon = 1/2\), the first case gives \(T(n) = \Theta(n)\), so T(n) = O(n) is true. The bound \(O(\sqrt{n})\) is too small, since the solution grows linearly, \(O(\log_2 n)\) is also too small, and \(O(n^2)\) is a true upper bound but not tight, so the question's key, the third option, is the intended tight statement.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development