Add files via upload
Add files via upload

for the solution stated below,
I am using base case if(n == 1) return x (mathematically correct);
instead of base case if(n == 0) return 1 (gives the correct answer);
though the latter mentioned base case is found more often in online solutions
T(n,k)  = 1 + T(n/2)
        = 2 + T(n/4)
        = k + T(n/2^k)

n/2^k = 1  -> the recursion will stop when T(base case) is hit
lgn = k    -> from the above statement we find k = lgn

T(n.k)  = lgn + T(1)  ->T(1) = 0
        = lgn + 0
        = lgn
AkibSadmanee/Search_Sort_Solve