public void insertSort(int arr[]){
for (int i = 1; i < arr.length; i++) {
int curValue = arr[i];
int curPos = i-1;
while (curPos>=0&&curValue<arr[curPos]){
arr[curPos+1] = arr[curPos];
curPos--;
}
arr[curPos+1] = curValue;
}
}
09-25
1106
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)