code: private void computeSuffix() {
          suffix[suffix.length-1] = suffix.length;
          int j = suffix.length - 1;
          //suffix[i] = m - the length of the longest prefix of p[i..m-1]
          for (int i = suffix.length - 2; i >= 0; i--) {
              while (j < suffix.length - 1 && pattern.charAt(j) != pattern.charAt(i)) {
                  j = suffix[j + 1] - 1;
              }
              if (pattern.charAt(j) == pattern.charAt(i)) { j--; }
              suffix[i] = j + 1;
          }
  
      }
docs: Computes the values of <code>suffix</code>, which is an auxiliary array,
  backwards version of the KMP failure function.
  <br>
  suffix[i] = the smallest j > i s.t. p[j..m-1] is a prefix of p[i..m-1],
  if there is no such j, suffix[i] = m, i.e. <br>
  p[suffix[i]..m-1] is the longest prefix of p[i..m-1], if suffix[i] < m.
  <br>
  The running time for computing the <code>suffix</code> is O(m).