开发者

finding all indexes of a keyword in a suffix tree

开发者 https://www.devze.com 2023-04-11 07:10 出处:网络
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\"

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消