博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Symbols of String Pattern Matching
阅读量:5165 次
发布时间:2019-06-13

本文共 1186 字,大约阅读时间需要 3 分钟。

Symbols of String Pattern Matching in Introduction to Algorithms.

 

As it's important to be clear when discussing the problem of string matching, we can use the meticulous symbols used in Introduction to Algorithms.

 

Text:    $T[1, ..., n]$.

Pattern:  $P[1, ..., m]$. 

Thus, as $T[i], P[j] \in \Sigma$, the array of letters, like $T[1, ..., n]$ or $P[1, ..., m]$, is called string.

 

Alphabet:  $\Sigma$.

Set of all finite length of strings:  $\Sigma^*$.

Define the empty string $\epsilon$, as it is a string, we also have $\epsilon \in \Sigma^*$.

 

Shifting $s$ matching:  $T[s+1, s+2, ..., s+m] = P[1, 2, ..., m]$.

 

$\omega$ is the prefix of string x:  Existing a string $y\in \Sigma^*$, such that $x=\omega y$, marked as $\omega \sqsubset x$.

$\omega$ is the suffix of string x:  Existing a string $y\in \Sigma^*$, such that $x=y \omega$, marked as $\omega \sqsupset x$.

 

Define $P_k$ as the prefix $P[1, ..., k]$ of string $P[1, ..., m]$. Thus we have: $P_0 = \epsilon, P_m = P = P[1, ..., m]$.

 

Based on the above symbols, the matching problem can be restated as:

Finding all the possible shifting values $s$, such that $P \sqsupset T_{m+s}$.

 

转载于:https://www.cnblogs.com/kid551/p/4386119.html

你可能感兴趣的文章
FTP文件传输服务端配置教程配图!本人亲测
查看>>
http/2.0与http/1.1区别
查看>>
iOS 证书权限分配
查看>>
spark视频-Spark on Docker深入揭秘
查看>>
iOS 基于 itemServices 进行本地安装 ipa 应用安装包
查看>>
当你输入一个网址的时候,实际会发生什么?
查看>>
常用机器学习方法总结
查看>>
EXTI中断开关点亮LED源码
查看>>
迷宫(maze)
查看>>
[原创]JQuery应用经验三
查看>>
android布局属性详解
查看>>
Divide and conquer:Median(POJ 3579)
查看>>
springMVC4 注解配置实例
查看>>
单片机编程
查看>>
LeetCode-327 Count of Range Sum
查看>>
根据文件夹地址获取txt文件并获取txt内容索引
查看>>
js控制只能输入数字
查看>>
Filter in Servlet
查看>>
HDU4662(SummerTrainingDay03-B)
查看>>
JavaScript基础——定义变量
查看>>