Merge Sort

The other sorting algorithms we’ve covered in the class – selection sort, insertion sort, and bubble sort – all suffer from the same general limitations and thus suffer the same, generally slow, worst-case runtime of O(n²). Merge sort, though, behaves in a fundamentally different manner, leveraging recursion to “pass the buck” of sorting but also accomplishing something drastically superior – O(n log n) runtime.