Google Answers Logo
View Question
 
Q: Data structure and algorithm ( Answered,   0 Comments )
Question  
Subject: Data structure and algorithm
Category: Computers > Algorithms
Asked by: math01-ga
List Price: $3.00
Posted: 16 Jul 2003 08:12 PDT
Expires: 15 Aug 2003 08:12 PDT
Question ID: 231632
Match the following subsequences using the longest common subsequence
dynamic programming algorithm:

A T C A T T A

T A T C A
Answer  
Subject: Re: Data structure and algorithm
Answered By: elmarto-ga on 16 Jul 2003 23:05 PDT
 
Hello again math01!
I wrote a code for the longest common subsequence in Matlab and used
it with the strings provided here. The answer would be that the
longest common subsequence is:

A T C A

which is 4 elements long. Since the longest possible subsequence could
be 5 elements long (because the second string is 5 elements long), and
T A T C A is not a subsequence of the first string, the longest common
subsequence can't possibly have 5 elements. Then A T C A, with 4
elements, is the longest common subsequence.

As in question #231621, simple algorithms to find the longest common
subsequence can be found at the following pages
 
Longest common subsequence 
http://freespace.virgin.net/cdm.henderson/site/cpp/lcs/ 
 
http://www-igm.univ-mlv.fr/~lecroq/seqcomp/node4.html 
 
I hope this helps! 
 
 
Google search strategy: 
 
algorithm "longest common subsequence" 
://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=algorithm+%22longest+common+subsequence%22
 
 
Best wishes! 
elmarto
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy