Could somebody please help me do a complexity analysis(deduction) of the insert algorithm of a binary search tree? I have no idea how to explain it in writing.
Never mind. I think I know it now. It's like 1+2+2^2+...2^k = n. That sum is equal to 2^(k+1)-3, which is equal to n. 2^(k+1) = n+3, then k+1 = log(2)(n+3), then k = log(2)(n+3) - 1, which is approximately log(2)n. Thanks!