public class InsertSort implements IArraySort {
public int[] sort(int[] sourceArray) throws Exception {
int[] arr = Arrays.copyOf(sourceArray, sourceArray.length);
// 从下标为1的元素开始选择合适的位置插入,因为下标为0的只有一个元素,默认是有序的
for (int i = 1; i < arr.length; i++) {
// 从已经排序的序列最右边的开始比较,找到比其小的数
while (j > 0 && tmp < arr[j - 1]) {