Complete Suffix Array

前端 未结 3 519
既然无缘
既然无缘 2020-12-29 16:58

A suffix array will index all the suffixes for a given list of strings, but what if you\'re trying to index all the possible unique substrings? I\'m a bit new at this, so h

3条回答
  •  滥情空心
    2020-12-29 17:51

    You should use a variation of 'Trie'. Essentially, if you have ABCD, create tree which is a merger of paths: root->A->B->C->D, root->B->C->D, root->C->D and root->D. Now, at every node keep a list of locations where string root->.->.->node was observed.

提交回复
热议问题