Hi, I started studying string alg's and I did not really understand how do we construct a suffix array in O(n*log n). I can implement an O(n^2 log n) alg. But it can fail for reasonably long strings. Can someone please provide a detailed implementation (if possible with comments) of the suffix array. I saw the codes of some users but I am not able to understand anything from it. Please help me. Thanks.
You can take help from here
You can follow this
https://stackoverflow.com/questions/34402080/suffix-array-construction-on-logn-competitive-programming-3-steven-halim
here is a code from a competitve programming book