String Algorithms
Print this page
Example
  • Let            P = abc
                     T = aabab
  • Compare P with 1st substring of T
 
 
Mismatch at the second character of T
Fig : 2(a)
  • Compare P with 2nd substring of T
 
Scince the corresponding character are same, there is a match at shift 1.
Fig : 2(b)
  • Compare P with 3rd substring of T
   
Mismatch at the 3rd character of T  
Fig : 2(c)
Prev