A konjac's understanding of suffix arrays (suffix arrays that konjac can also understand)

Preface about Suffix Arrays

suffix array is clam? ? , suffix arrays are a very powerful tool for working with strings.

I think suffix arrays are more practical than suffix automata.

The suffix array is to sort all the suffixes of a string and store them in an array.

This amazing data structure can handle things like...

Find the longest common prefix of any two suffixes
The number of different substrings
Longest repeating substring (can overlap)
longest repeating substring (non-overlapping)
longest common substring
longest palindromic substring
Problem with multiple strings
Without further ado, let's get to the point! !

1. Construction of suffix array

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326529702&siteId=291194637