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: We say that the string x = x1x2 ... xn is a and there are indices subsequence of the string y = y1y2 ... ym in the usual such that, way: and there are indices such that, . The goal is a . 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!