43F. Summary and Optimality of Merge Sort

Insertion Sort is a simple but expensive sorting algorithm. It takes Θ(n2) time to sort a list (or array) of n values.

Merge Sort sorts a list (or array) of n things in Θ(nlog(n)) time. For large values of n, that is much faster than Insertion Sort.

A comparison algorithm is an algorithm whose only access to the values to be sorted is by comparing two of the values. Both Insertion Sort and Merge Sort are comparison algorithms. It can be shown that every comparison algorithm must make at least about nlog(n) comparisons to sort n values. Merge Sort makes slightly more than that many comparisons. But, at least among comparison algorithms, Merge Sort can only be improved on by a small constant factor.