package com.abin.lee.algorithm.insert;
import java.util.Arrays;
public class InsertSort {
public static void main(String[] args) {
int[] input = {6,1,4,2,5,8,3,7,9,0};
input = InsertSort.sort(input);
System.out.println(Arrays.toString(input));
}
public static int[] sort(int[] input){
int temp = 0;
for(int i=0;i<input.length;i++){
temp = input[i];
int j=i-1;
for(;j>=0&&temp<input[j];j--){
input[j+1] = input[j];
}
input[j+1] = temp;
}
return input;
}
}