Originally Posted by
JBow94
Arrays.sort though.
Hmm, I was just about to ask that question
Well you could just generate the effect yourself you need to check for the lowest, and keep looping till your new array is the size of the original:
//Time
public static int[] sort(int[] unsorted) {
int[] sorted = new int[unsorted.length];
boolean[] usedIndex = new boolean[unsorted.length];
int size = 0;
while(size != unsorted.length) {
int lowest = Integer.MAX_VALUE;
int finalCur = -1;
for(int x = 0; x != unsorted.length; x++) {
if(!usedIndex[x]) {
if(lowest > unsorted[x]) {
lowest = unsorted[x];
finalCur = x;
}
}
}
usedIndex[finalCur] = true;
sorted[size++] = lowest;
}
return sorted;
}