Merge pull request #1279 from littleFoot1/master

I find a problem
This commit is contained in:
Stepfen Shawn
2020-04-17 01:46:42 -05:00
committed by GitHub

View File

@ -22,10 +22,11 @@ public class ShellSort implements SortAlgorithm {
for (; gap > 0; gap /= 3) {
for (int i = gap; i < length; i++) {
int j;
for (j = i; j >= gap && less(array[j], array[j - gap]); j -= gap) {
T temp = array[i];
for (j = i; j >= gap && less(temp, array[j - gap]); j -= gap) {
array[j] = array[j - gap];
}
array[j] = array[i];
array[j] = temp;
}
}
return array;