@Override
  public int[] reverse(int[] S, int start, int end) {
    for (int i = start, j = end - 1; i < j; ++i, --j) {
      swap(S, i, j);
    }