fléchette de shell

void shellSort(List<int> arr, int n) {
    for (int gab = (n / 2).floor(); gab > 0; gab = (gab / 2).floor()) {
      for (int i = gab; i < n; ++i) {
        int j = i;
        int temp = arr[i];
        for (j = i; j >= gab && temp < arr[j - gab]; j -= gab) {
          arr[j] = arr[j - gab];
        }
        arr[j] = temp;
      }
    }
    print(arr);
  }
}
Old-fashioned Okapi