Let's see how the Trie tree is constructed before you see it.
The words on the tree are (from top to bottom)
{He, hers, his, she}
Divided into 3 layers as shown in the figure
See the third floor
It's "she."
which
①s point to Root
②h first find the fail pointer of S, found to be the number NO. 0 pointer, not h,
Then H is not happy, then ask s the fail pointer root: "You have no son and I named H."
Root says: "Yes, you point to him."
Then H was pleased to point to the first line of H.
③e began to look, first asked his father H: "Your fail pointer pointing to who"
H said, "The first line on the chart, the H ah."
Then E went to the top of the line and asked, "Do you have a son like me?"
On the first line of the picture, the H said, "Yes, he's the address xxx."
The last e's fail pointer points to the XXX address, which is the first line of the E.
found that, if a string to find the third line after the E character characters mismatch, it means that he should have a ' he ' in front
The failed pointer to just e points to the E of the first line of ' he ... '.
This saves time by not having to look for it again from H, but then the first line of E to continue looking backwards.
AC Automaton---fail pointer