3 Consider Two Strings Xxxyxzxy Xzzzx Find Longest Subsequence Form Matrix Fill Show Work Q37029930

3. Consider the two strings XXXYxzxY and xzzzX. Find the longest subsequence. Form the matrix and fill it in. Show all wor
c++3. Consider the two strings “XXXYxzxY” and “xzzzX. Find the longest subsequence. Form the matrix and fill it in. Show all work. Show transcribed image text 3. Consider the two strings “XXXYxzxY” and “xzzzX. Find the longest subsequence. Form the matrix and fill it in. Show all work.


Answer


#include<iostream>

#include<cstdlib>

#include<cstring>

using namespacestd;

void lcs(const char *,constchar *);

void print_lcs(char **,constchar*,int,int);

int main()

{

    string s1,s2;

   

    cout<<“Please providetwo input sequences..n”;

   cin>>s1>>s2;

   

    const char *str1=s1.c_str();

    const char *str2=s2.c_str();

   

   lcs(str1,str2);

   

    return0;

}

void lcs(const char*str1, const char*str2)

{

    intlen1,len2,i,j;

   

    //

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.