Quote:Original post by smitty1276
And regardless, it still doesn't answer my question of why Trap said mergesort was O(2^n). I suppose he just mistyped.
Because it is:
1) Definition of big-oh: it is O(2^n) if and only if there exist numbers x0 and M such that |f(n)| ≤ M |2^n| for n > x0.
2) Plug in f(n)=n*log(n)
3) Set M=1 and x0=1 and the prove n*log(n) ≤ 2^n for n>1 by induction
4) You have proven mergesort to be O(2^n)