in Algorithms retagged by
1,075 views
1 vote
1 vote

What is the solution to the recurrence $T(n)=T \bigg (\dfrac{n}{2} \bigg )+n$?

  1. $O(\log n)$
  2. $O(n)$
  3. $O(n\log n)$
  4. None of these
in Algorithms retagged by
by
1.1k views

1 comment

No base case given. Assume for (n<=1) T(n) = 1.
0
0

1 Answer

1 vote
1 vote
O(n)----option B

simply apply master theorem and compare here ,

a=1,b=2

then ,, compare n^logba----->put a and b value get 1 ,,,right side fuction is already 'n'  so n is bigger so the answer will be O(n)
Answer:

Related questions