Question: Implement a C++ program for the following problem: Consider two strings as follows. ABCBDAB BDCABA The longest matched substring allowing for gap s (LMSAFG) is
Implement a C++ program for the following problem:
Consider two strings as follows.
ABCBDAB
BDCABA
The longest matched substring allowing for gap s (LMSAFG) is the longest (could be a tie) such substring matched between the two strings such that gaps are allowed but the sequence is maintained (in either direction). So, the LMSAFG are as follows in the given example.
BCBA , BCAB , BDAB , BADB , BACB , ABCB
Write a program in C++ to print all such LMSAFG using the above test.
PLEASE ~ do not copy/paste the code from: http://www.geeksforgeeks.org/longest-common-subsequence/ I have already tried to modify this code to accomplish this, but I can't get it working.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
