Merge Sort Algorithm
The merge sort algorithm is a divide-and-conquer sort: split the list in half, sort each half, then merge the two sorted halves. It guarantees O(n log n) time and keeps equal items in order, which is why it sits at the heart of many library sorts. Step through it below, then read how it works….
