-1

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!!

Dev Dev
  • 31
  • 4
  • I don't think it is completely clear what you are asking for, but you can find completed solutions for both if you google them. For example, a suffix tree implementation is found at http://www.sanfoundry.com/java-program-implement-suffix-tree/ – rp.beltran Mar 09 '16 at 22:47
  • I could find implementations for suffix tree but not suffix trie. Are the structures similar for both? Basically, my question is to represent the Nodes in a Suffix Trie and a Suffix Tree. – Dev Dev Mar 09 '16 at 23:01
  • 1
    http://stackoverflow.com/questions/13893950/suffix-tree-and-tries-what-is-the-difference, http://stackoverflow.com/questions/2042825/short-java-implementation-of-a-suffix-tree-and-usage – Andrew Regan Mar 10 '16 at 00:17
  • Possible duplicate of [Generalized Suffix Tree Java Implementation](http://stackoverflow.com/questions/969448/generalized-suffix-tree-java-implementation) – Andrew Regan Mar 10 '16 at 00:19
  • Folks - thanks for commenst but those are all implementations of "SuffixTrees" not "SuffixTries" – Dev Dev Mar 10 '16 at 11:40

1 Answers1

1

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?.

Community
  • 1
  • 1
Micromega
  • 12,486
  • 7
  • 35
  • 72