Presentation is loading. Please wait.

Presentation is loading. Please wait.

String Matching: Knuth-Morris-Pratt algorithm Heather Takeguchi.

Similar presentations

Presentation on theme: "String Matching: Knuth-Morris-Pratt algorithm Heather Takeguchi."— Presentation transcript:


2 String Matching: Knuth-Morris-Pratt algorithm Heather Takeguchi

3 What is String Matching? Used in word find in document, as well as in the spell checker and in internet keyword searches Looking for an exact string match Reality of algorithms are more complicated; search string ‘string’ results in ‘String’ as well as ‘stringbean’

4 How do you match strings? Finite-State-Automota Brute-Force Knuth-Morris-Pratt (KMP) visualization tool for Brute Force and KMP

5 Virus Detection Detection of virus is simply searching for a pattern string in a larger text. 1) viral signature (contagious seg.) matching 2) code enumeration (cmp. to old known file) 3) checksum methods (see size of file)

6 Variation-tolerant matching Fast substring matching approximate string matching –voice recognition –dna sequencing

7 Example: x = GATAA and y = CAGATAAGAGAA and k = 1


9 Summary Exact string matching good for grep & sed String matching used in word find and in internet key word searches KMP alg. is slightly better than Brute Force approximate string matching and fast substring matching can be used for a wider use to practical applications.

10 Acknowledgements Virus detection: /je/a24.html Speech recognition: www.kom.e-technik.tu- oceedings/robertson/ Approximate string matching: http://www-igm.univ- Cormen, chaper 34

Download ppt "String Matching: Knuth-Morris-Pratt algorithm Heather Takeguchi."

Similar presentations

Ads by Google