Exact String Matching Algorithms

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 8

Exact string

matching
Algorithms

Himanshu Patidar
Manish Chouriya
Shubham Patidar
 Introduction
 Brute Force Algorithm
 Karp-Rabin Algorithm
 Knuth-Morris-Pratt Algorithm
 Shift-Or Algorithm
 Boyer-Moore Algorithm
 Bibliography
Introduction
 String searching algorithms search for patterns
within strings.

 They outputs all occurrences of a pattern in a text.

 Pattern: x = x[0. .m-1] (length = m)


Text string: y=y[0. .n-1] (length = m)
Working:
 Scan text with help of a window (size = m).
 Firstly, left ends of window and text are left-
aligned and then compared- ‘Attempt’.
 After, a whole pattern match or mismatch – shift
the window to right.
 Repeatthe procedure – until right end of window
goes beyond right end of text.

 Mechanism is known as sliding window


mechanism.

You might also like