MergeSort(A)
- If A.size > 1
- Split(A,B,C)
- MergeSort(B)
- MergeSort(C)
- Merge(A,B,C)
- EndIF
Split
is $O(n)$
Merge
is $O(n)$
MergeSort
is then
$$ T(n) = \begin{cases}
O(1) & \text{for } n=1 \\
2T(n/2) + 2n & \text{for } n > 1\\
\end{cases}
$$