I’m working out the recurrence relation
T(n) = T(3/4 * n) + O(1)
It’s coming out to be O(log(n)), but I was told before hand that the solution is O(n). I can’t find where I’m going wrong – this looks just like the recurrence relation for binary search. Any suggestions?
Try substituting
T(n) = c*norT(n) = c * log ninto the equation and solving. One of the two equations will be solvable.You can also check your answer by evaluating the function for different values of n.
One of these will converge to a small positive number, the other will go to zero or infinity.