
/**
* author Akalius Kung 2008-2-9
**/
public class InsertionSort {
private int[] sort(int[] array){
for(int j=1;j<array.length;j++){
int swapLoc = j; // init the location where to insert
for(int i=j-1;i>=0;i--){ // get the location where to insert
if(array[i]>array[j]){
swapLoc=i;
}
}
// backward the elems between swapLoc and j
int temp=array[j];
for(int k=j-1;k...