@Override
    public List<Integer> sort(List<Integer> list) {

        // checking input parameter for null
        if (list == null) {
            throw new IllegalArgumentException("ArrayList not specified!");
        }

        int i, j, increment, temp, arraySize = list.size();

        // moving forward through array.
        for (increment = arraySize / 2; increment > 0; increment /= 2) {

            for (i = increment; i < arraySize; i++) {
                temp = list.get(i);
                for (j = i; j >= increment; j -= increment) {

                    // comparing distant elements
                    if (temp < list.get(j - increment)) {
                        list.set(j, list.get(j - increment));
                    } else {
                        break;
                    }
                }
                list.set(j, temp);
            }
        }
        return list;
    }