class Sort {

    public static void insertSort(int[] data) {
        int len = data.length;
        for (int i = 0; i < len; i++) {
            int currVal = data[i];
            int preIndex = i - 1;
            while (preIndex >= 0 && data[preIndex] > currVal) {
                data[preIndex + 1] = data[preIndex];
                preIndex--;
            }
            data[preIndex + 1] = currVal;
        }
    }

}