Longest common subsequence
The problem of finding a sequence that is a subsequence of each of a given set of sequences and is as long as possible
A longest common subsequence (LCS) is the longest subsequence common to all sequences in a set of sequences (often just two sequences). It differs from the longest common substring: unlike substrings, elements of subsequences are not required to occupy consecutive positions within the original sequences.
Nº Q141001 ★
Common · Knowledge
Longest common subsequence
The problem of finding a sequence that is a subsequence of each of a given set of sequences and is as long as possible
A longest common subsequence (LCS) is the longest subsequence common to all sequences in a set of sequences (often just two sequences). It differs from the longest common substring: unlike substrings, elements of subsequences are not required to occupy consecutive positions within the original sequences.
From Wikipedia
A longest common subsequence (LCS) is the longest subsequence common to all sequences in a set of sequences (often just two sequences). It differs from the longest common substring: unlike substrings, elements of subsequences are not required to occupy consecutive positions within the original sequences. The problem of computing longest common subsequences is a classic computer science problem. Because it is polynomial and has an efficient algorithm to solve it, it is employed to compare data and merge changes to files in programs such as the diff utility and revision control systems such as Git. It has similar applications in computational linguistics and bioinformatics. For example, consider the sequences (ABCD) and (ACBAD). They have five length-2 common subsequences: (AB), (AC), (AD), (BD), and (CD); two length-3 common subsequences: (ABD) and (ACD); and no longer common subsequences. So (ABD) and (ACD) are their longest common subsequences.
Text: Wikipédia, CC BY-SA 4.0. · Image: User:Retraza (CC BY-SA 3.0) ·
Related cards
-
L
Longest increasing subsequence
Algorithm to find the longest increasing subsequence in an array of numbers
Nº Q4183855 ★
Not listed
-
S
Subset sum problem
Decision problem in computer science
Nº Q1154420 ★★
Not listed
-
S
Subsequence
Binary relation between sequences (strings)
Nº Q1332977 ★
Not listed
-
Maximum subarray problem
The task of finding a contiguous subarray with the largest sum in a given array of numbers
Nº Q1334332 ★★
Not listed
-
Substring
Subsequence of the symbols in a string, where the order of the elements is preserved
Nº Q2626534 ★
Not listed
-
L
Lucas sequence
One of certain constant-recursive integer sequences
Nº Q1759646 ★★
Not listed