
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question

Transcribed Image Text:Complete the tables for dynamic programming for the Longest Common
Sub-sequence (LCS) Problem on X = CGAT AC and Y = ACGCT AC.
Let c(i, j) represent the length of LCS(X;,Y;), where X;
the first i letters of X and Y; = (y1, Y2, . .. , Y;) contains the first j letters of Y.
(x1, x2, . .. , xi) contains
Fill in the missing values of the entries.
A
A
1
1
1
1
G
2
2
2
A
A
In the following, each entry b(i, j) E {†,\,+} represents the direction of recursion for
c(i, j). Specifically,b(i, j) =K if x; = Yj; otherwise, b(i, j) =† if c(i – 1, j) > c(i, j– 1);
b(i, j) =+- if c(i – 1, j) < c(i, j – 1).
Fill in the missing values of the entries.
b
A
G
A
C
C
What is the LCS of X and Y?
Ulo -
uloKE
O o o o o o o
O O o oo o
GATAU
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a C++ program that fills a 5 x 5 matrix of integers. The matrix must be a static matrix; its size must be fixed at compile-time. Display the contents of the matrix. Query the user for an integer. Pass the matrix and the integer to a bool function that searches for the first occurrence, and only the first occurrence, of the integer in thematrix. If the integer is found, the function returns true (and passes back the row and column coordinates of the first occurrence of the integer); if not, the function returns false. Main then displays whether the integer was found in the matrix and if so, the coordinates of the first occurrence. The use of a break to exit a loop or a function should be avoided. My code does not find the location of the first occurrence and does not use a bool function. Can you please help me to find the error. This is my code: #include <iostream> #include <random> using namespace std; int main() { int guess, array[5][5]; bool found = false; for(int…arrow_forward*Data Structures (a) The function g(n) is a/an [?] bound on f(n). A. upper B. tight C. lower (b) The function f(n) is a/an [?] bound on g(n). A. upper B. tight C. lower (c) The function g(n) is a/an [?] bound on h(n). A. upper B. tight C. lower (d) The function j(n) is a/an [?] bound on g(n). A. upper B. tight C. lower (e) The function h(n) is a/an [?] bound on k(n). A. upper B. tight C. lower (f) The function k(n) is a/an [?] bound on f(n). A. upper B. tight C. lowerarrow_forward1. I Complete the Python function MySpline that reads in a set of x and y values (each as arrays or lists), and outputs a piecewise-cubic function with natural boundary conditions. The function prototype is cs MySpline (x, y) The returned function can be called using cs (2.4) or cs ([2.4, 3.7]), for example. You will have to find the parameter values for the as, bs, and cs so that the cubic spline can be evaluated using Pi(x)= ai-11 + ai + bk (x₁+1-x)+ ci(x − x₁), 6h₁ where hi=i+1; and i = 1,2,..., n - 1. Note that all Python indexing starts at 0, so all the indices can be decremented by 1. However, some care is needed to handle ao,..., an-1. See the documentation for MySpline for some guidance on this issue. (x+1-x)³ 6h₁ The function MySpline is already set up to return a cubic spline function. But it's not a very interesting one, and it does not pass through the points (x, y). The notebook has a small sample set of points to interpolate. Feel free to choose your own set of points.…arrow_forward
- A quadratic function is a function of the form f(x) = ax**2 +bx + c Define a function quad_coefficients which accepts a quadratic function f as input, and returns a tuple containing the value a at index 0, b at index 1, and c at index 2. do this in pythonarrow_forwardwrite a c++ recursive function to solve the following: str contains a single pair of parenthesis, return a new string // made of only the parenthesis and whatever those parensthesis contain. You can use substr in this problem. // // Pseudocode Example:// findParen("abc(ghj)789") => "(ghj)" // findParen("(x)7") => "(x)" // findParen("4agh(y)") => "(y)" // string findParen(string str) { }arrow_forward4. Given the following recursive definitionseq(1) = seq(2) = 1seq(n) = 2 ∗ seq(n − 1) + 3 ∗ seq(n − 2)implement the corresponding program and use it to calculate seq(5).How many invocations are made to the function seq when calculating seq(5)?arrow_forward
- I need help coding this in C language. Problem Given the employee's traversal of the park, and the exhibits that the visitors want to visit determine howmany unique monkeys the visitor will see on their way from the entrance to the exhibit and then back. Input Input will begin with a line containing 1 integer, n (1 ≤ n ≤ 200,000), representing the number of exhibitsin the park (including the entrance). The following line contains 2 integers, i and m (i = 1; 1 ≤ m ≤ 5,000), representing the ID of the entrance and the number of monkeys at the entrance. Each of the following 2n - 2 lines will contain a path description recorded by our employee. If this is the first time the employee used the path, then the line will contain two integers, i and m (2 ≤ i ≤ n; 1 ≤ m ≤ 5,000), representing the ID of the destination exhibit and the monkeys at the destination exhibit respectively. If this is the second time the path is used, then the line will contain the integer -1 instead, since the ID and…arrow_forwardIn C++: Given the following recursive definition seq(1) = seq(2) = 1 seq(n) = 2*seq(n-1) + 3*seq(n-2) implement the corresponding program and use it to calculate seq(5). How many invocations are made to the function seq when calculating seq(5)?arrow_forwardThe MATLAB function arg supports variable arguments, returns the sum of the number of arguments and all arguments, and has a help function. Write the arg so that the next execution results. >> help argIt supports variable arguments. >> [n,m] = arg(5,6)n = 2m = 11>> [n, m] = arg(3,4,5)n = 3m = 12arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education