Assign next rank to every suffix
for ( int i = 0 ; i < n ; i ++ ) { int nextindex = suffixes [ i ] . index + k / 2 ; suffixes [ i ] . rank [ 1 ] = ( nextindex < n ) ? suffixes [ ind [ nextindex ] ] . rank [ 0 ] : -1 ; }