How to sort a set of integers
I have an int array containing a set of integers, and an empty ArrayList.
I want to find the biggest integer and add it into the ArrayList, and then find the second biggest one and add it into the ArrayList as well, and the 3rd biggest one, as so on.
How to achieve that? Could anyone write a sample code for me? Thanks in advance!
[351 byte] By [
Wenxiaoa] at [2007-10-2 13:06:09]

Do you really need to follow those steps? Or do you just want to end up with a sorted ArrayList?
If the latter, you can either sort the array with Arrays.sort and then use Arrays.asList to get a List out of it, or you can use Arrays.asList first, and then call Collections.sort on the resulting list.
jverda at 2007-7-13 10:30:21 >
