finding all indexes of a keyword in a suffix tree
This is a visual graph of a suffix tree for the input text "mississippi". In this example, my keyword that I'm searching for is "si". I think I understand how to get the first index of "si"
- start at root node #1
- first edge is "s", so we travel down to node #2
- second edge of node #2 is "i", so we retrieve node #7, and this node stores the index into the text.
But now for the second occurrence of "si"... do I just continue searching down the subtree #7 for the next occurrence? Doesn't really make sense to me.
Or, does the tree have to be assembled in a different way in orde开发者_开发百科r to support multiple indexes?
精彩评论