Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Radix Sort

 
george harvin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am down to the end of the semester and running out of time for a lot of things. 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.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

It's worth noting that this site is about learning, not about passing classes. People won't do your work for you. If you want help, post the relevant code, or an SSCCE equivalent, and ask a specific question.
 
Winston Gutkowski
Bartender
Pie
Posts: 10259
59
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic