2

I know a similar question has been asked (Prefix vs Suffix Trie in String Matching) but the accepted answer did not help me understand my query. The question is: What advantage does a suffix trie have over a prefix trie ?

Community
  • 1
  • 1
random40154443
  • 1,100
  • 1
  • 10
  • 25

2 Answers2

0

Suffix tries allows you to choose the beginning of the string and look how long they match. It is probably similar to accepted answer on the original question but that's the best I can do.

Murat Akburak
  • 51
  • 1
  • 1
  • 12
0

You can try look at aho-corasick algorithm. It is a finite state machine and basically it uses a special prefix trie with failure links from the prefixes to the first occurence of the longest suffices in the trie. Basically it is a breadth-first search of the trie. AC is used in fast multiple pattern matching.

Micromega
  • 12,486
  • 7
  • 35
  • 72