Hi, I don't know why you insist on using radix sort, as it will be slower than a regular sort when sorting strings. Here is how it could work: - determine the length L of the longest string; - treat all strings as having length L by virtually appending NULL characters; - the Nth "digit" of a string has a value that equals the (int) value of its Nth character (where you use zero if N exceeds the string length). So sort all strings according to their (L-1)th character then sort according to their (L-2)th character etc and finally sort according to their first character As I said, it will be slow, as you have to get the characters, one by one, and compare those, whereas a normal sort would be based on a comparer method (such as string.Compare) that takes the whole string into account right away. :)
Luc Pattyn
:badger: :jig: :badger:
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
:jig: :badger: :jig: