How does key index counting work?
How does LSD String sort work?
Consider characters from right to left
Perform key-indexed counting on each char of the strings
Each string needs to be the same length
How does MSD work?
Create count array of size R + 2 and set values to 0
1. Count frequencies of first character
2. Transform the counts into indices
3. Distribute back
2. Sort subarrays corresponding to each character excluding first. Therefore sort(array, distributed index for character, lo + count[r+1] - 1, d + 1)
What is the running time for LSD and MSD?
LSD: NW
MSD: N and Nw
Where is the sweet spot for LSD and MSD?
LSD: short fixed-length strings
MSD: Random strings