public class Fuck<T> {
public static void sort(Comparable[] arr){
int n = arr.length;
for(int i=0;i<n;i++){
for(int j=i;j>0;j--){
if(arr[j].compareTo(arr[j-1])<0)
swap(arr,j,j-1);
else
break;
}
}
}
private static void swap(Object[] arr,int i,int j){
Object t = arr[i];
arr[i] = arr[j];
arr[j] = t;
}
public static void main(String[] arg){
int n = 20000;
Integer[] arr = Fuck.RandomArray(10,10);
Fuck.sort(arr);
for(int i : arr){
System.out.print(i);
}
}
private static Integer[] RandomArray(int length, int max){
Integer[] array = new Integer[length];
for(int i =0;i<length;i++){
array[i] = (int) (Math.random()*max);
}
return array;
}
}