子列(字符串)

来自GSXAB的知识库
子序列
术语名称 子序列
英语名称 subsequence
别名 子列
真子序列
术语名称 真子序列
英语名称 proper subsequence
别名 真子列

子序列(subsequence)指两个字符串中一个字符串是另一个字符串作为序列子序列,或者说,一个字符串是另一个字符串中不要求连续的字符按顺序组成的部分,一个字符串中插入一些其他字符可以得到另一个字符串。

定义

子序列
关系名称 子序列
关系符号
Latex
关系对象 字符串
关系元数 2
类型 偏序
全集 [math]\displaystyle{ \Sigma^*\times \Sigma^* }[/math]

[math]\displaystyle{ \Sigma }[/math] 上的字符串 [math]\displaystyle{ s = \mathtt{s}_1 \mathtt{s}_2 \cdots \mathtt{s}_n }[/math][math]\displaystyle{ t = \mathtt{t}_1 \mathtt{t}_2 \cdots \mathtt{t}_m }[/math] ,若 [math]\displaystyle{ (\exists i_1,i_2\cdots,i_m\in \mathbb{N}^*)(i_1\lt i_2\lt \cdots\lt i_m \land \mathtt{s}_{i_1}=\mathtt{t}_1 \land \mathtt{s}_{i_2}=\mathtt{t}_2 \land \cdots \land \mathtt{s}_{i_m}=\mathtt{t}_m) }[/math] ,则称字符串 [math]\displaystyle{ t }[/math] 是字符串 [math]\displaystyle{ s }[/math]子序列(subsequence),简称子列

真子序列
关系名称 真子序列
关系符号
Latex
关系对象 字符串
关系元数 2
类型 拟序
全集 [math]\displaystyle{ \Sigma^*\times \Sigma^* }[/math]

若子序列定义中, [math]\displaystyle{ s\neq t }[/math] 或者说 [math]\displaystyle{ n\gt m }[/math],则称字符串 [math]\displaystyle{ t }[/math] 是字符串 [math]\displaystyle{ s }[/math]真子序列(proper subsequence)。


字符串
特殊字符串 空字符串 [math]\displaystyle{ \varepsilon }[/math]
运算 长度 [math]\displaystyle{ |\bullet| }[/math]
连接 [math]\displaystyle{ \bullet \bullet }[/math]
自连接 [math]\displaystyle{ \bullet^n }[/math] Kleene 闭包 [math]\displaystyle{ \bullet^* }[/math] 、 Kleene+ 闭包 [math]\displaystyle{ \bullet^+ }[/math]
反转 [math]\displaystyle{ \bullet^\mathrm{R} }[/math]
关系 子串 子列
前缀、后缀 公共前后缀