54 const std::string a =
"AGGTAB";
55 const std::string b =
"GXTXAYB";
60 std::cout <<
"LCS / Longest Common Substring Example\n";
61 std::cout <<
"a = " << a <<
"\n";
62 std::cout <<
"b = " << b <<
"\n\n";
64 std::cout <<
"LCS length: " <<
lcs.length <<
"\n";
65 std::cout <<
"LCS value : " <<
lcs.subsequence <<
"\n\n";
67 std::cout <<
"Longest Common Substring length: " <<
lcss.length <<
"\n";
68 std::cout <<
"Substring: " <<
lcss.substring <<
"\n";
69 std::cout <<
"Begin in first string : " <<
lcss.begin_a <<
"\n";
70 std::cout <<
"Begin in second string: " <<
lcss.begin_b <<
"\n";
Dynamic-programming algorithms for string similarity and alignment.
int main()
Example program demonstrating longest_common_subsequence and longest_common_substring.
Main namespace for Aleph-w library functions.
LCS_Result longest_common_subsequence(const std::string_view a, const std::string_view b)
Compute Longest Common Subsequence.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
Longest_Common_Substring_Result longest_common_substring(const std::string_view a, const std::string_view b)
Compute the longest common substring (contiguous) between two strings.