Solution: Shortest Common Supersequence
This review provides a detailed analysis of the different ways to solve the shortest common supersequence problem
We'll cover the following...
We'll cover the following...
Solution #1: Brute Force
In this solution, we try all the superstrings–one character at a time.
Pseudocode
IF the sequences have a matching character
skip one character from both the sequences and make a recursive call for the remaining lengths.
IF the characters don’t match
we call the function recursively twice by skipping one character from each string. We return the minimum result of these two calls.
Time Complexity
The time complexity of the above algorithm is exponential ...