SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Rabin-Karp Substring search
algorithm
1
Prepared By:
Sabiya Fatima
sabiya1990fatima@gmail.com
Objectives
2
 What is Substring search problem
 Definition of the Rabin-Karp algorithm
 How Rabin-Karp works
 An example to illustrate Rabin-Karp
 Complexity Analysis
 Real Life applications
What is Substring search Problem
3
We assume that the text is an array T [1..N] of length n and that the pattern is an array P [1..M]
of length m, where m << n.
We also assume that the elements of P and T are characters in the finite alphabet S.
(e.g., S = {a,b} We want to find P = ‘aab’ in T = ‘abbaabaaaab’)
 A string search algorithm which compares a string's hash values, rather than the strings
themselves.
 For efficiency, the hash value of the next position in the text is easily computed from the
hash value of the current position.
Definition of the Rabin-Karp Algorithm
4
How Rabin-Karp Works
5
 Let characters in both arrays T and P be digits in radix-S notation. S = (0,1,...,9)
 Let p be the value of the characters in P
 Choose a prime number q such that fits within a computer word to speed
computations.
 Compute (p mod q)
 The value of p mod q is what we will be using to find all matches of the pattern P in T.
How Rabin-Karp Works(Contd.)
6
 Compute (T[s+1, .., s+m] mod q) for s = 0 .. n-m
 Test against P only those sequences in T having the same (mod q) value
 (T[s+1, .., s+m] mod q) can be incrementally computed by subtracting the high-order digit,
shifting, adding the low-order bit, all in modulo q arithmetic.
Algorithm
7
RABIN-KARP-MATCHER(T,P,d,q)
1. n = T.length
2. m= P.length
3. h = d^(m-1) mod q
4. p = 0
5. t0 = 0
6. for i = 1 to m // preprocessing
7. p = (dp + p[i]) mod q
8. t0 = (dt0 + p[i]) mod q
9. for s = 0 to n-m // matching
10. if p == ts
11. if P[1 . . . . M] == T[ s+1 . . . . s+m]
12. print “Pattern occurs with shift” s
13. if s<(n + m)
14. ts+1 = (d(ts – T[s+1]h)+T[s+m+1]) mod q
An Example to illustrate Rabin-Karp
8
• Given T = 31415926535 and P = 26
• We choose q = 11
• P mod q = 26 mod 11 = 4
13 14 95 62 35 5
13 14 95 62 35 5
14 mod 11 = 3 not equal to 4
31 mod 11 = 9 not equal to 4
13 14 95 62 35 5
41 mod 11 = 8 not equal to 4
An Example to illustrate Rabin-Karp(contd.)
9
13 14 95 62 35 5
15 mod 11 = 4 equal to 4 -> spurious hit
13 14 95 62 35 5
59 mod 11 = 4 equal to 4 -> spurious hit
13 14 95 62 35 5
92 mod 11 = 4 equal to 4 -> spurious hit
13 14 95 62 35 5
26 mod 11 = 4 equal to 4 -> an exact match!!
13 14 95 62 35 5
65 mod 11 = 10 not equal to 4
An Example to illustrate Rabin-Karp(contd.)
10
13 14 95 62 35 5
53 mod 11 = 9 not equal to 4
13 14 95 62 35 5
35 mod 11 = 2 not equal to 4
As we can see, when a match is found, further testing is done to insure that a match has
indeed been found.
Complexity Analysis 11
RABIN-KARP-MATCHER(T,P,d,q)
1. n = T.length
2. m= P.length
3. h = d^(m-1) mod q O(1)
4. p = 0
5. t0 = 0
6. for i = 1 to m O(m)
7. p = (dp + p[i]) mod q
8. t0 = (dt0 + p[i]) mod q
9. for s = 0 to n-m O((n-m+1)m)
10. if p == ts
11. if P[1 . . . . M] == T[ s+1 . . . . s+m]
12. print “Pattern occurs with shift” s
13. if s<n + m
14. ts+1 = (d(ts – T[s+1]h)+T[s+m+1]) mod q
Complexity Analysis Result
12
 The running time of the Rabin-Karp algorithm in the worst-case scenario is
O((n-m+1))m but it has a good average-case running time.
 If the expected number of valid shifts is small O(1) and the prime q is chosen to be
quite large, then the Rabin-Karp algorithm can be expected to run in time O(n+m) plus
the time to required to process spurious hits.
Real Time Applications
13
 Bioinformatics
• Used in looking for similarities of two or more proteins; i.e. high sequence
similarity usually implies significant structural or functional similarity.
Example:
Hb A_human
GSAQVKGHGKKVADALTNAVAHVDDMPNALSALSDLHAHKL
G+ +VK+HGKKV A++++++AH+ D++ ++ +++LS+LH KL
Hb B_human
GNPKVKAHGKKVLGAFSDGLAH LDNLKGTF ATLSELH CDKL
+ similar amino acids
14
 Good for plagiarism, because it can deal with multiple pattern matching!
 With a good hashing function it can be quite effective and it’s easy to implement!
Real Time Applications
References
15
.
 Cormen, Thomas S., et al. Introduction to Algorithms. 3rd ed. Boston: MIT Press, 2
 Go2Net Website for String Matching Algorithms
 [www.go2net.com/internet/deep/1997/05/14/body.html]
 Yummy Yummy Animations Site for an animation of the Rabin-Karp algorithm at work
[www.mills.edu/ACAD_INFO/MCS/CS/S00MCS125/String.Matching.Algorithms/animations.html]
 National Institute of Standards and Technology Dictionary of Algorithms, Data Structures, and Problems
 [hissa.nist.gov/dads/HTML/rabinKarpAlgo.html]
 Multi-Pattern String Matching with Very Large Pattern Sets
 [https://www.dcc.uchile.cl/~gnavarro/workshop07/lsalmela.pdf]
Thank You
16

Weitere ähnliche Inhalte

Was ist angesagt?

Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Ehtisham Ali
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
Ankit Katiyar
 
Pattern matching
Pattern matchingPattern matching
Pattern matching
shravs_188
 

Was ist angesagt? (20)

Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
String matching, naive,
String matching, naive,String matching, naive,
String matching, naive,
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 
Brute force
Brute forceBrute force
Brute force
 
String Matching (Naive,Rabin-Karp,KMP)
String Matching (Naive,Rabin-Karp,KMP)String Matching (Naive,Rabin-Karp,KMP)
String Matching (Naive,Rabin-Karp,KMP)
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Pumping lemma for regular language
Pumping lemma for regular languagePumping lemma for regular language
Pumping lemma for regular language
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Kmp
KmpKmp
Kmp
 
String matching algorithm
String matching algorithmString matching algorithm
String matching algorithm
 
Compiler design syntax analysis
Compiler design syntax analysisCompiler design syntax analysis
Compiler design syntax analysis
 
Pattern matching
Pattern matchingPattern matching
Pattern matching
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Boyer moore algorithm
Boyer moore algorithmBoyer moore algorithm
Boyer moore algorithm
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 

Ähnlich wie Rabin Carp String Matching algorithm

Ähnlich wie Rabin Carp String Matching algorithm (20)

String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
String searching
String searching String searching
String searching
 
StringMatching-Rabikarp algorithmddd.pdf
StringMatching-Rabikarp algorithmddd.pdfStringMatching-Rabikarp algorithmddd.pdf
StringMatching-Rabikarp algorithmddd.pdf
 
String-Matching Algorithms Advance algorithm
String-Matching  Algorithms Advance algorithmString-Matching  Algorithms Advance algorithm
String-Matching Algorithms Advance algorithm
 
Modified Rabin Karp
Modified Rabin KarpModified Rabin Karp
Modified Rabin Karp
 
Knuth morris pratt string matching algo
Knuth morris pratt string matching algoKnuth morris pratt string matching algo
Knuth morris pratt string matching algo
 
KMP String Matching Algorithm
KMP String Matching AlgorithmKMP String Matching Algorithm
KMP String Matching Algorithm
 
lec17.ppt
lec17.pptlec17.ppt
lec17.ppt
 
Lec17
Lec17Lec17
Lec17
 
Ch08
Ch08Ch08
Ch08
 
Ch08
Ch08Ch08
Ch08
 
String matching algorithms(knuth morris-pratt)
String matching algorithms(knuth morris-pratt)String matching algorithms(knuth morris-pratt)
String matching algorithms(knuth morris-pratt)
 
6.sequences and series Further Mathematics Zimbabwe Zimsec Cambridge
6.sequences and series   Further Mathematics Zimbabwe Zimsec Cambridge6.sequences and series   Further Mathematics Zimbabwe Zimsec Cambridge
6.sequences and series Further Mathematics Zimbabwe Zimsec Cambridge
 
25 String Matching
25 String Matching25 String Matching
25 String Matching
 
Basics of Mathematical Cryptography
Basics of Mathematical CryptographyBasics of Mathematical Cryptography
Basics of Mathematical Cryptography
 
Pattern matching programs
Pattern matching programsPattern matching programs
Pattern matching programs
 
Primality
PrimalityPrimality
Primality
 
1. linear model, inference, prediction
1. linear model, inference, prediction1. linear model, inference, prediction
1. linear model, inference, prediction
 
Daa chapter9
Daa chapter9Daa chapter9
Daa chapter9
 
Introduction to the AKS Primality Test
Introduction to the AKS Primality TestIntroduction to the AKS Primality Test
Introduction to the AKS Primality Test
 

Kürzlich hochgeladen

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 

Kürzlich hochgeladen (20)

Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 

Rabin Carp String Matching algorithm

  • 1. Rabin-Karp Substring search algorithm 1 Prepared By: Sabiya Fatima sabiya1990fatima@gmail.com
  • 2. Objectives 2  What is Substring search problem  Definition of the Rabin-Karp algorithm  How Rabin-Karp works  An example to illustrate Rabin-Karp  Complexity Analysis  Real Life applications
  • 3. What is Substring search Problem 3 We assume that the text is an array T [1..N] of length n and that the pattern is an array P [1..M] of length m, where m << n. We also assume that the elements of P and T are characters in the finite alphabet S. (e.g., S = {a,b} We want to find P = ‘aab’ in T = ‘abbaabaaaab’)
  • 4.  A string search algorithm which compares a string's hash values, rather than the strings themselves.  For efficiency, the hash value of the next position in the text is easily computed from the hash value of the current position. Definition of the Rabin-Karp Algorithm 4
  • 5. How Rabin-Karp Works 5  Let characters in both arrays T and P be digits in radix-S notation. S = (0,1,...,9)  Let p be the value of the characters in P  Choose a prime number q such that fits within a computer word to speed computations.  Compute (p mod q)  The value of p mod q is what we will be using to find all matches of the pattern P in T.
  • 6. How Rabin-Karp Works(Contd.) 6  Compute (T[s+1, .., s+m] mod q) for s = 0 .. n-m  Test against P only those sequences in T having the same (mod q) value  (T[s+1, .., s+m] mod q) can be incrementally computed by subtracting the high-order digit, shifting, adding the low-order bit, all in modulo q arithmetic.
  • 7. Algorithm 7 RABIN-KARP-MATCHER(T,P,d,q) 1. n = T.length 2. m= P.length 3. h = d^(m-1) mod q 4. p = 0 5. t0 = 0 6. for i = 1 to m // preprocessing 7. p = (dp + p[i]) mod q 8. t0 = (dt0 + p[i]) mod q 9. for s = 0 to n-m // matching 10. if p == ts 11. if P[1 . . . . M] == T[ s+1 . . . . s+m] 12. print “Pattern occurs with shift” s 13. if s<(n + m) 14. ts+1 = (d(ts – T[s+1]h)+T[s+m+1]) mod q
  • 8. An Example to illustrate Rabin-Karp 8 • Given T = 31415926535 and P = 26 • We choose q = 11 • P mod q = 26 mod 11 = 4 13 14 95 62 35 5 13 14 95 62 35 5 14 mod 11 = 3 not equal to 4 31 mod 11 = 9 not equal to 4 13 14 95 62 35 5 41 mod 11 = 8 not equal to 4
  • 9. An Example to illustrate Rabin-Karp(contd.) 9 13 14 95 62 35 5 15 mod 11 = 4 equal to 4 -> spurious hit 13 14 95 62 35 5 59 mod 11 = 4 equal to 4 -> spurious hit 13 14 95 62 35 5 92 mod 11 = 4 equal to 4 -> spurious hit 13 14 95 62 35 5 26 mod 11 = 4 equal to 4 -> an exact match!! 13 14 95 62 35 5 65 mod 11 = 10 not equal to 4
  • 10. An Example to illustrate Rabin-Karp(contd.) 10 13 14 95 62 35 5 53 mod 11 = 9 not equal to 4 13 14 95 62 35 5 35 mod 11 = 2 not equal to 4 As we can see, when a match is found, further testing is done to insure that a match has indeed been found.
  • 11. Complexity Analysis 11 RABIN-KARP-MATCHER(T,P,d,q) 1. n = T.length 2. m= P.length 3. h = d^(m-1) mod q O(1) 4. p = 0 5. t0 = 0 6. for i = 1 to m O(m) 7. p = (dp + p[i]) mod q 8. t0 = (dt0 + p[i]) mod q 9. for s = 0 to n-m O((n-m+1)m) 10. if p == ts 11. if P[1 . . . . M] == T[ s+1 . . . . s+m] 12. print “Pattern occurs with shift” s 13. if s<n + m 14. ts+1 = (d(ts – T[s+1]h)+T[s+m+1]) mod q
  • 12. Complexity Analysis Result 12  The running time of the Rabin-Karp algorithm in the worst-case scenario is O((n-m+1))m but it has a good average-case running time.  If the expected number of valid shifts is small O(1) and the prime q is chosen to be quite large, then the Rabin-Karp algorithm can be expected to run in time O(n+m) plus the time to required to process spurious hits.
  • 13. Real Time Applications 13  Bioinformatics • Used in looking for similarities of two or more proteins; i.e. high sequence similarity usually implies significant structural or functional similarity. Example: Hb A_human GSAQVKGHGKKVADALTNAVAHVDDMPNALSALSDLHAHKL G+ +VK+HGKKV A++++++AH+ D++ ++ +++LS+LH KL Hb B_human GNPKVKAHGKKVLGAFSDGLAH LDNLKGTF ATLSELH CDKL + similar amino acids
  • 14. 14  Good for plagiarism, because it can deal with multiple pattern matching!  With a good hashing function it can be quite effective and it’s easy to implement! Real Time Applications
  • 15. References 15 .  Cormen, Thomas S., et al. Introduction to Algorithms. 3rd ed. Boston: MIT Press, 2  Go2Net Website for String Matching Algorithms  [www.go2net.com/internet/deep/1997/05/14/body.html]  Yummy Yummy Animations Site for an animation of the Rabin-Karp algorithm at work [www.mills.edu/ACAD_INFO/MCS/CS/S00MCS125/String.Matching.Algorithms/animations.html]  National Institute of Standards and Technology Dictionary of Algorithms, Data Structures, and Problems  [hissa.nist.gov/dads/HTML/rabinKarpAlgo.html]  Multi-Pattern String Matching with Very Large Pattern Sets  [https://www.dcc.uchile.cl/~gnavarro/workshop07/lsalmela.pdf]