¶¶Òõ̽̽

Radix sort for strings

Author

Clayton Cafiero

Published

2025-01-05

We don’t go over this in any video lectures, but in case you’re interested here’s a quick implementation of radix sort for strings. We work from right to left, and make use of the fact that char types have an underlying representation as an int (so, for example the letter ‘a’ has a value of 97). This is by way of a proof of concept, and is restricted to three-character strings of lower-case ASCII letters, but it will give you an idea of how radix sort works for strings. Have a look.

Radix sort for strings

Copyright © 2023–2025 Clayton Cafiero

No generative AI was used in producing this material. This was written the old-fashioned way.

Reuse