MSD vs LSD radix sort

algorithm, radix-sort, sorting

Solution

One advantage of LSD radix sort over MSD radix sort is that LSD radix sort is a stable sort - if there are multiple elements to sort with the same key, they'll end up in the same relative order in the sorted output when you run LSD radix sort, but might not if you run MSD radix sort. If you're sorting key/value pairs where the key is a string or an integer and you want to preserve the original relative ordering, LSD radix sort would be preferable over MSD radix sort.

Hope this helps!

Problem

I'm not sure why would one ever use LSD radix sort. Advantages of MSD: - It can handle strings of variable length - It doesn't always need to scan the entire strings (it ca decide sooner about the order) - One can use insertion sort to circumvent the disadvantages of counting sort.

Original source