304 views
0 votes
0 votes
T(n) = T(n^1/2) + n

doing this in substitution method gives the ans as O(n)

but using tree recursion gives the ans as O(nlogn)

which of these are correct and which has to be considered for worst case

1 Answer

0 votes
0 votes
First of all, no matter which method you use, you will get the same answer. Secondly, you have not provided the base case.

Related questions

580
views
1 answers
1 votes
iarnav asked Mar 29, 2018
580 views
*****NOTE: I'm not looking to find the Time Complexity, but I'm looking for number of comparisons and the answer is3/2n -2T(n) = 2T(n/2) +2 T(2) = 1T(1) = 0and I' ... 2k+2k-1+ . . . +2and I found out k = log n-1, but stuck at solving for k.
2.6k
views
1 answers
1 votes
iarnav asked Jul 29, 2017
2,583 views
Given RR as -T(n) = 2T(n/2)+n ; n>1T(1) = 1Solve this using only BACK SUBSTITUTION method? Note - I am stuck at T(n)= 2^k.T(n/2^k)+(2^k-1).nand I'm putting 2^k=n Please help me I am getting wrong answer!
568
views
1 answers
2 votes
indrajeet asked Feb 10, 2016
568 views
T(n) = 2*T(n/2) + n*logn please explain
567
views
1 answers
3 votes
sampad asked Nov 23, 2015
567 views
Solve the equation: $a_n = 5a_{n/3} + 7, \;\; a_1 = 5$Note: $a_0$ is not given.