src/io/github/marwlod/burrows_wheeler/BurrowsWheeler.java
// reading from standard input and writing to standard output
reading from standard input and writing to standard output
reading from standard input and writing to standard output
public static void transform() {
        final String in = BinaryStdIn.readString();
        final CircularSuffixArray csa = new CircularSuffixArray(in);
        for (int i = 0; i < csa.length(); i++) {
            if (csa.index(i) == 0) {
                BinaryStdOut.write(i);
                break;
            }
        }
        for (int i = 0; i < csa.length(); i++) {
            final int a = (csa.index(i) + csa.length() - 1) % csa.length();
            BinaryStdOut.write(in.charAt(a));
        }
        BinaryStdOut.flush();
    }
public static void transform ( ) { final String in = BinaryStdIn . readString ( ) ; final CircularSuffixArray csa = new CircularSuffixArray ( in ) ; for ( int i = 0 ; i < csa . length ( ) ; i ++ ) { if ( csa . index ( i ) == 0 ) { BinaryStdOut . write ( i ) ; break ; } } for ( int i = 0 ; i < csa . length ( ) ; i ++ ) { final int a = ( csa . index ( i ) + csa . length ( ) - 1 ) % csa . length ( ) ; BinaryStdOut . write ( in . charAt ( a ) ) ; } BinaryStdOut . flush ( ) ; }
reading from standard input and writing to standard output
reading from standard input and writing to standard output
// index of last character of i-th original suffix // last character in i-th sorted suffix