george harvin wrote:One last assignment I have to do for my java class is modify a prewritten radix sort for integers so that it will radix sort strings instead. I really am at quite a loss on what to do here and it isn't terribly important that I actually learn much from this assignment as we are already at the end of the class and we will not be tested on the content covered in this assignment. Is there anyone that would mind taking a look at the code provided and helping me out? I would rather not post all of the code here for obvious reasons. Thanks for your time.
As Jeff said.
I will, however, offer this advice: If the original radix sort was sorting based on 'digits' (ie, base 10), then a
String radix sort is likely to be based around characters (ie, base 65536). If your code basically does that, chances are it's probably right. Furthermore, the business of extracting a 'digit' is already provided for you.
Remember: in Java, a
char is a
numeric type.
Winston