876 views
1 1 vote

*****NOTE: I'm not looking to find the Time Complexity, but I'm looking for number of comparisons and the answer is

3/2n -2


T(n) = 2T(n/2) +2 

T(2) = 1

T(1) = 0

and I'm stuck at this point - 

T(n)= 2k T(n/2k) + 2k+2k-1+ . . . +2

and I found out k = log n-1, but stuck at solving for k.

1 Answer

Position:
Show:

Related questions

1 1 vote
1 1 answer
982
982 views
kallu singh asked Aug 13, 2017
982 views
Q. In Quick sort ,for sorting n element ,the (n/4)th smallest element is selected as pivot using an O(n) time algorithm. What is the worst case tome complexity of the Qu...
1 1 vote
1 1 answer
1.2k
1.2k views
2 2 votes
2 2 answers
2.0k
2.0k views
3 3 votes
1 1 answer
4.3k
4.3k views
dd asked Aug 11, 2016
4,338 views
recurrence relation for the functional value of F(n) is given below :$F(n) = a_{1}F(n-1) + a_{2}F(n-2) + a_{3}F(n-3) + \ldots + a_{k}F(n-k)$ where $a_{i} =$ non zero con...