*This preview shows
pages
1–5. Sign up
to
view the full content.*

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
**Unformatted text preview: **1 String Matching Algorithms Topics Basics of Strings Brute-force String Matcher Rabin-Karp String Matching Algorithm KMP Algorithm CSE5311 Kumar 2 In string matching problems, it is required to find the occurrences of a pattern in a text. These problems find applications in text processing, text-editing, computer security, and DNA sequence analysis. Find and Change in word processing Sequence of the human cyclophilin 40 gene CCCAGTCTGG AATACAGTGG CGCGATCTCG GTTCACTGCA ACCGCCGCCT CCCGGG TTCA AACGATTCTC CTGCCTCAGC CGCGATCTCG : DNA binding protein GATA-1 CCCGGG : DNA binding protein Sma 1 C: Cytosine, G : Guanine, A : Adenosine, T : Thymine CSE5311 Kumar 3 Text : T [1.. n ] of length n and Pattern P [1.. m ] of length m . The elements of P and T are characters drawn from a finite alphabet set Σ . For example Σ = {0,1} or Σ = { a,b, . . . , z }, or Σ = { c, g, a, t }. The character arrays of P and T are also referred to as strings of characters. Pattern P is said to occur with shift s in text T if 0 ≤ s ≤ n-m and T[s+1..s+m] = P[1..m] or T[s+j] = P[j] for 1 ≤ j ≤ m , such a shift is called a valid shift. The string-matching problem is the problem of finding all valid shifts with which a given pattern P occurs in a given text T . CSE5311 Kumar 4 Brute force string-matching algorithm To find all valid shifts or possible values of s so that P[1..m] = T[s+1..s+m ] ; There are n-m+1 possible values of...

View
Full
Document