Data Structures/Suffix Array + LCP Array.cpp
// Used for smart sorting while building SA
Used for smart sorting while building SA
Used for smart sorting while building SA
bool suffcmp(int i, int j)
{
    if( buck[i] != buck[j] )
        return buck[i] < buck[j];
    i += it, j += it;
    if(i < n && j < n)
        return buck[i] < buck[j];
    else
        return i > j;
}
bool suffcmp ( int i , int j ) { if ( buck [ i ] != buck [ j ] ) return buck [ i ] < buck [ j ] ; i += it , j += it ; if ( i < n && j < n ) return buck [ i ] < buck [ j ] ; else return i > j ; }
Used for smart sorting while building SA
Used for smart sorting while building SA
// If they're in different buckets // If they're in the same bucket, jump it positions // Compare again