String Matching

Some definition


  • A word u is a prefix of a word w is there exists a word v (possibly empty) such that \(w=uv\)
  • A word v is a suffix of a word w is there exists a word u (possibly empty) s.t. that \(w=uv\)
  • A word z is a substring or a subword or a factor of a word w is there exist two words u and v (possibly empty) s.t. \(w=uzv\)
  • A integer p is a period of a word w if for \(i,0\leq i< m-p,w[i]=w[i+p]\). The smallest period of w is called the period of w, it is denoted by per(w).
  • A word w of length \(\ell\) is periodic if the length of its smallest period is smaller or equal to \(\frac{\ell}{2}\), otherwise it is non-periodic.
  • A word w is basic if it cannot be written as a power of another word: there exist no word z and no integer k s.t \(w=z^k\)
  • A word z is a border of a word w if there exist two words u and v s.t. \(w=uz=zv,z\) is both a prefix and a suffix of w. Note that in this case |u|=|v| is a period of w.
posted @ 2020-03-18 09:54  IdiotNe  阅读(76)  评论(0)    收藏  举报