In this assignment, you will implement the compact representation of the compressed suffix trie ADT for DNA analyses. A template of the compressed suffix trie class is shown as follows:
public class CompressedSuffixTrie
{
/** You need to define your data structures for the compressed trie */
/** Constructor */
public CompressedSuffixTrie( String f ) // Create a compressed suffix trie from file f
{ }
/** Method for finding the first occurrence of a pattern s in the DNA sequence */
public int findString( String s )
{ }
} The data structures for the compressed suffix trie are not given in the above template. You need to define them yourself. The constructor creates a compressed suffix trie from an input text file f that stores a DNA sequence. All the characters of the DNA sequence are A, C, G and T. The findString(s) method has only one parameter: a pattern s. If s appears in the DNA sequence, findString(s) will return the index j of the first occurrence of s in the DNA sequence. Otherwise, it will return –1. For example, if the DNA sequence is AAACAACTTCGTAAGTATA, then findString(“CAACT”) will return 3 and findString(“GAAG”) will return –1. Note that the index of the first character of the DNA sequence is 0. 麻烦高手给出完整的java代码,谢谢啊!!
public class CompressedSuffixTrie
{
/** You need to define your data structures for the compressed trie */
/** Constructor */
public CompressedSuffixTrie( String f ) // Create a compressed suffix trie from file f
{ }
/** Method for finding the first occurrence of a pattern s in the DNA sequence */
public int findString( String s )
{ }
} The data structures for the compressed suffix trie are not given in the above template. You need to define them yourself. The constructor creates a compressed suffix trie from an input text file f that stores a DNA sequence. All the characters of the DNA sequence are A, C, G and T. The findString(s) method has only one parameter: a pattern s. If s appears in the DNA sequence, findString(s) will return the index j of the first occurrence of s in the DNA sequence. Otherwise, it will return –1. For example, if the DNA sequence is AAACAACTTCGTAAGTATA, then findString(“CAACT”) will return 3 and findString(“GAAG”) will return –1. Note that the index of the first character of the DNA sequence is 0. 麻烦高手给出完整的java代码,谢谢啊!!
lz翻译一下。
看懂了再能解决。