插入排序:在局部有序的情况下
int []m = new int[]{1,2,5,7,8,9,30,44,21,62,698};
for(int out =0;out<m.length;out++){
int temp = m[out];
int in = out;
while(in>0 && m[in -1]>temp){
m[in] = m[in -1];
--in;
}
m[in] = temp;
}
int []m = new int[]{1,2,5,7,8,9,30,44,21,62,698};
for(int out =0;out<m.length;out++){
int temp = m[out];
int in = out;
while(in>0 && m[in -1]>temp){
m[in] = m[in -1];
--in;
}
m[in] = temp;
}