What is a suffix automaton (SAM).
Probably understood as an optimization for inserting n suffixes into the letter tree for violence.
First it is an automaton.
For a string s S S, Sam S A M Sam can recognize all of its suffixes. There is also a series of expansion applications. some analysis and proof
Use St (ST) s t (S T) St (ST) to indicate the state in the automaton from the initial state along the string St walk.
The String St (a) S T (a) st (a) can identify x x x when and only if AX a x ax is the suffix of s s S.
So a State st (a) S T (a) st (a) can identify which suffixes, only depending on right (a) R i g H T (a) right (a).
Defines the right (a) R i g H t (a) to (a) that indicates that a a a A is present at S S s so that the position is located at the end of the collection.
Specifically: Set a A A in S S s where the position appears as [L1,r1], [L2,R2],..., [LN,RN] [l 1, R 1), [L 2, R 2), ..., [l N, R N] [l_1,r_1], [l_2,r _2),..., [L_n,r_n),