Search code examples
javatriesuffix-tree

Suffix Trie and Suffix Tree


I understand the difference between (Prefix) Trie, a Suffix Trie and a Suffix Tree and I am trying to write Java code for both. What is the Java representation/structure of the SuffixTrieNode and SuffixTreeNode class?

SuffixTrie representation:

class SuffixTrie{
   SuffixTrieNode root;

   class SuffixTrieNode{
      SuffixTrieNode[] links;
   }
}

SuffixTree representation:

class SuffixTree{
   SuffixTreeNode root;

   class SuffixTreeNode{
      SuffixTreeNode[] links;
   }
}

Thanks!!


Solution

  • A suffix trie uses a trie data structure. It is the simplest way to build a suffix tree:Suffix tree and Tries. What is the difference?.