Question: We say that the string x = x 1 x 2 ... x n is a subsequence of the string y = y 1 y
We say that the string x = x1x2 ... xn is a subsequence of the string y = y1y2 ... ym in the usual way:
and there are indices
such that,
. The goal is a greedy strategy to test in O(n+m) time whether x is a subsequence of y (no code is required)
(a) Describe the greedy choice
(b) Justify the correctness of your greedy choice.
1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
