Merge Sort I
Premium Content - Free Preview
Like QuickSort, MergeSort runs quickly in O(n log n) time. While Mergesort uses more space and is not usually as fast (in practice) as Quicksort, Mergesort has the benefit of being stable, which means it keeps duplicate elements in the original order that they started with. This is meaningless if the values being sorted is all there is, but usually there's associated data with each element which sometimes needs to be preserved in the original order. For example, if you sort by one value of an item, and then by another value, you may not want the second sort to mess up the order of the first sort.
Stable Sort Example
End of Free Content Preview. Please Sign in or Sign up to buy premium content.
Panashe FundiraJun 19, 11:03 AM
I like the quotes :)
Just wish it would run code a little faster though
LearnerooJun 19, 11:09 AM
The code usually runs in a few seconds (and doesn't display quotes), but sometimes it needs to fall back to a different server.