0

There is the following algorithm:

Recursive_Search(A,low,high,k)
1 if low=high 
2    if[low] = k
3       return low;
4    return 0;
5 third = floor((hig+2*low)/3);
6 ind = Recursive_Search(A,low,third);
7 if ind != 0
8    return ind;
9 return Recursive_Search(A,third+1,high);

I know that the cost of the algorithm will be something like $T(n)=T(n/3)+T(2n/3)+1$ and that it will be $O(n)$. But how do I prove that $T(n) \in O(n)$?

0 Answers0