Split Sorting, also known as Divide-and-Conquer

Split sorting involves dividing the list into smaller lists,
and then sorting the smaller lists - possibly dividing them into smaller lists and so on.
After the split lists are sorted, they are then recombined.
The way the list is split can be arbitrary (like merge sort), which makes the splitting fast but the combining slow.
Or list can be split carefully (like quick sort), which makes the splitting slow but the combining fast.

Since sorting a list is typically O(N2), sorting two-half lists is typically twice as fast (twice as many lists, but four times faster for each smaller list).
Each split improves the sort time, but the act of splitting/combining takes time itself, and Split Sort ends up being O(N log N).

The two big names in split sorting are Quick Sort and Merge Sort.
Quick Sort averages slightly faster than Merge Sort, but it can randomly be horrible.
Merge Sort finishes in O(N log N) guaranteed, but requires more moves on average, and a buffer as large as the set being sorted.
Which is better depends on whether you're worried most about memory, average time, or worst case time.

6 4 2 Split Sort 5 3 1 6 4 2 5 3 1 6 4 2 5 3 1 6 4 2 5 3 1 5 3 1 4 2 6 6 4 2 5 3 1 6 4 2 5 3 1 Split Split Split Combine Combine Combine

^ UP ^    < Back <    > Next >