zoukankan      html  css  js  c++  java
  • Symbols of String Pattern Matching

    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 $yin Sigma^*$, such that $x=omega y$, marked as $omega sqsubset x$.

    $omega$ is the suffix of string x:  Existing a string $yin 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}$.

  • 相关阅读:
    CentOS安装
    java字符串
    h5弹球对战游戏
    看是否健康
    layui社区源码笔记之fly-list
    layui社区源码笔记之user-rank
    layui社区源码笔记之layui-input form
    layui社区源码笔记之fly-tab
    layui社区模板主页框架分析
    分组答辩小程序
  • 原文地址:https://www.cnblogs.com/kid551/p/4386119.html
Copyright © 2011-2022 走看看