The same answer as the other correct answer simply turned out to be different.
From this repetition, all of the following equations are created:
- T (n) = T (n-1) + Log ((n + 1) / n)
- T (n-1) = T (n-2) + Log (n / (n-1))
- .
- .
- .
- T (2) = T (1) + Log (3/2)
The summation of all RHS and LHS in the above equations leads to:
- T (n) = T (1) + Log (3/2) + Log (4/3) + ... + Log ((n + 1) / n)
Log (a) + Log (b) = Log (ab),
- T (n) = 1 + Log ((n + 1)/2)
- T (n) = Log (10) + Log ((n + 1)/2) = Log (5n + 5), , 10 1 = Log 10 10
, T (n) = O (log (5n + 5)) = O (Log (n))