# Module9_08 - 1 String Matching Algorithms Topics Basics of...

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

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

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...
View Full Document

## This document was uploaded on 11/18/2009.

### Page1 / 13

Module9_08 - 1 String Matching Algorithms Topics Basics of...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online