Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void lcp(int*sa,int*lcp,int n,uc*s){
- static int r[MX];
- F(n)r[sa[i]]=i,lcp[i]=0;;
- int h(0);F(n)if(r[i]<n-1){
- for(int j(sa[r[i]+1]);s[i+h]==s[j+h];++h);
- lcp[r[i]]=h;
- if(h)--h;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement