suffix trie

refer to here for short representation of trie.

Let’s see what a suffix trie is:
Given a string A = a0a1…an – 1, denote by Ai = aiai + 1…an – 1 the suffix of A that begins at position i. Let n = length of A.

The suffix trie is made by compressing all the suffixes of A1…An – 1 into a trie, as in the figure below.

Operations on this structure are very easily done:

   a) checking whether a string W is a substring of A(complexity O(W)).

   b) searching the longest common prefix for two suffixes.

   c) finding the k-th suffix in lexicographic order.

原文地址:https://www.cnblogs.com/catch/p/2913731.html