Hello I am taking Introduction to algorithm class this semeseter. However I have some problem in calculating time complexity of median of medians algorithm (here).
I'm wondering how to get T(n)<=10cn from T(n)<=T(0.2n)+T(0.7n)+cn..
I think I cannot apply mater theorem to the expression above and wikipedia says I should use induction but I don't know How..
It is using induction. Assume for less than or equal
nwe haveT(n) <= 10*c*n(we know the base of induction is true for equal or less thanT(10)as they are constant and we can use large enough value forc). Now we want to prove this forT(n + 1). We knowT(n + 1) <= T(0.2(n + 1)) + T(0.7( n + 1)) + c(n+1). From the assumption of the induction as0.2(n + 1)and0.7(n+1)is less thann(forn > 10),T(0.2(n + 1)) <= 10*c*0.2(n + 1)andT(0.7(n + 1)) <= 10*c*0.7(n + 1). Therefore,T(n+1) <= 2*c(n+1) + 7*c(n+1) + n*c = 10*c*n. The proof is completed!