GATE | Gate IT 2005 | Question 51
Let T(n) be a function defined by the recurrence
T(n) = 2T(n/2) + √n for n ≥ 2 and
T(1) = 1
Which of the following statements is TRUE?
(A) T(n) = θ(log n)
(B) T(n) = θ(√n)
(C) T(n) = θ(n)
(D) T(n) = θ(n log n)
Explanation: n(logba) = n which is = n^(1-.5) = O(sqrt n)
then by applying case 1 of master method we get T(n) = Θ(n)
Please refer https://www.geeksforgeeks.org/analysis-algorithm-set-4-master-method-solving-recurrences/ for more details.
Quiz of this Question
Attention reader! Don’t stop learning now. Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.
Learn all GATE CS concepts with Free Live Classes on our youtube channel.