Sort a string lexicographically by reversing a substring

  #include using namespace std;  bool adjust(string& S, int& i,            int& start, int& end){        int N = S.length();              start = i – 1;              while (i < N && S[i] < S[i - 1]) {                  i++;    }              end = i - 1;          if (start = N)        return true;          if (start >= 1 && i = S[start – 1]                && S[start] = 1) {                  return S[end] >= S[start – 1];    }          if (i < N) {                                  return S[start]