跳到主要内容

资源 · 指南或文章

Shortest Common Supersequence

定义两个字符串的最短公共超序列,并指出它与最长公共子序列的联系。

审核日期

打开原站: Shortest Common Supersequence (在新标签页中打开原网站)

添加到路线图

把这个资源放进你正在跟进的路线图。它会作为你自己的补充资源显示;路线图的步骤不会改变,也不计入你已记录的步骤。

来源内容语言:英语

The shortest common supersequence (SCS) of two sequences X and Y is the shortest sequence which has X and Y as subsequences. In other words assume we're given two strings str1 and str2, find the shortest string that has both str1 and str2 as subsequences. This is a problem closely related to the longest common subsequence problem.

PrepKit 概览

本概览由 PrepKit 编辑根据源代码仓库撰写并审核,并非资源本身的文字。

适合人群
来源未说明适用级别
形式
参考资料

涵盖内容

  • 定义及其与 LCS 的关系。
  • 两组输入输出示例,包括由 geek 和 eke 得到 geeke。

使用建议

这是 PrepKit 的学习建议,并非来源的说法。

复用 LCS 表构造 AGGTAB 和 GXTXAYB 的 SCS,确认答案长度为 9,并解释如何由 LCS 长度推算出这个长度。

范围与局限

没有求解方法或复杂度;唯一的参考资料是 GeeksForGeeks。

获取方式与形式

GitHub 上的免费英文 README,出自 trekhleb/javascript-algorithms(MIT)。

PrepKit 于 2026年10月2日 审核。 资源来源提交: 85293e3e2b88

本概览的依据
  • src/algorithms/sets/shortest-common-supersequence/README.md

收录此条目的页面

订阅 PrepKit 通讯

可选。使用 PrepKit 并不需要订阅。

我们如何处理你的邮箱