Uses of suffix trees - PrismoSkills
Read full article from Uses of suffix trees - PrismoSkills
1) Finding a string that occurs more than 'm' times in the text
A node (with contents from root to that node as ‘c’) which has ‘k’ leaf level children indicates that ‘c’ occurs ‘k’ times in the text. For example, in the suffix tree above, ‘e’ has 3 leaf-level-children, so it must occur 3 times in ‘peeper’. Similarly, ‘pe’ has 2 leaf level children, so it occurs 2 times in ‘peeper’.
Hence to find a string that occurs more than ‘m’ times in a text, we find all nodes in the trie which have more than ‘m’ leaf level children. For all those nodes, strings from root to those nodes occur more than ‘m’ times.