Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have the following brute-force algoritm problem that I don't really understand. The Computational Problem: Assume you have two sequences X and Y of the

I have the following brute-force algoritm problem that I don't really understand.
image text in transcribed
The Computational Problem: Assume you have two sequences X and Y of the same length m>1, where each sequence contains integer values. The goal of this problem is to find a subsequence 5 which has the following properties: 1. The subseguence s is common to both X and . 2. The subsequence S length is maximum among any other common subsequences. 3. The subsequence S cannot be empty. 4. The values in subsequence S are consecutive values in X and Y. Brute-force algorithm: Generate al possible subsequences of X, and all subsequences of Y. Then, for each subsequence sx in X, and for each subsequence sy in Y. check if sxand sy are equal if so, then compare its length with the maximum common subsequence found so far and kefep the maximum length subsequence. Input Format Input consists of two 1-dimenional arrays of size m, where m>1 Output Format Output is: - ni length of the subsequence S - Astarting index in sequence X for the first element in S - f:starting index in sequence Y for the first element in S Example 1: X={2,4,6,8,10,12,14,16,18,20}Y={13,15,18,1,3,5,8,10,12,20} Longest common subsequence is S={8,10,12) with length 3 n=3i=4j=7

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago