Originally posted by Greg Harris:
sounds like a homework assignment for a java class in school...
Originally posted by Greg Harris:
sounds like a homework assignment for a java class in school...
Originally posted by Daniel Dunleavy:
Would you like fries with that?
Originally posted by Joe McGuire:
Guru, here's something to help get you started.
Check out the Arrays class in java.util API. It provides a series of sort() methods for sorting arrays. Check it out, it's really not difficult at all. Good luck!
----------------------<br />regards.<br /><a href="http://www.mantrotech.com/editors/gaurav_mantro.asp" target="_blank" rel="nofollow">Gaurav Mantro</a><br /><a href="http://www.mantrotech.com/technology/java/index.asp" target="_blank" rel="nofollow">Java Information Portal</a> - <a href="http://www.mantrotech.com/technology/java/index.asp" target="_blank" rel="nofollow">http://java.mantrotech.com</a>
"JavaRanch, where the deer and the Certified play" - David O'Meara
Originally posted by guru mysore:
I just want the code instead of explanation of how to do it.
Don't sweat the petty stuff, just pet the sweaty stuff.
Originally posted by guru mysore:
Hi All,
Can you help me how to write a program to sort an array of integers: A[0]=9
A[0]=3
A[0]=7
in the ascending order?
I just want the code instead of explanation of how to do it.
Regards,
Guru
Email:[email protected]
Wait a minute, I'm trying to think of something clever to say...<p>Joel
Originally posted by Scott Appleton:
My policy is not to post code for anyone who just wants answers without wanting to learn how to do it for themselves (which fortunately seems to be very rare here at JavaRanch). I consider this a professional advice forum, not some kind of Java code swap meet.
Originally posted by Scott Appleton:
My policy is not to post code for anyone who just wants answers without wanting to learn how to do it for themselves (which fortunately seems to be very rare here at JavaRanch). I consider this a professional advice forum, not some kind of Java code swap meet.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Originally posted by Scott Hiett:
Just cuz I am nit picky, I found that using the default sort just goes by alphanumeric while sorting.
I need something to take these values from the DB and sort them. But because they were strings, they came back ordered alphanumerically (ie 1,10,11,2,20,3,3000,4...etc).
So I wrote a little NumericComparator to pass into the sort method. Whaddya think?
So a call with (in my case) a Vector(vic) of strings is
Don't get me started about those stupid light bulbs. |