STRING MATCHING ALGORITHMS
Google images
OUTLINE
ï‚ą What is String?
ï‚ą What is String Matching?
ï‚ą Definition of Algorithm
ï‚ą String Matching Algorithms
ï‚ą String Matching Algorithms Applications
WHAT IS STRING?
ï‚ą In computer programming, a string is traditionally a
sequence of characters, either as constant or as
some kind of variable
ï‚ą E.g. ABCABDC or 1Ac35D
Google images
WHAT IS STRING?
ï‚ą String may be applied in Bioinformatics to describe
DNA strand composed of nitrogenous bases
Google images
WHAT IS STRING MATCHING?
ï‚ą String matching is finding occurrence(s) of a pattern
string within another string or body of text
ï‚ą E.g. We have a string “BCATDOG” and the pattern
to be searched is “CAT”. Now finding “CAT” in the
string “BCATDOG” is string matching
WHAT IS STRING MATCHING?
ï‚ą Uses for the string matching include:
 Finding a text in a document file or in a report
 Used by different search engines like: Google
Google images
EXAMPLE
Google images
DEFINITION OF ALGORITHM
ï‚ą Algorithm is formula or set of rules followed for
solving a problem.
ï‚ą Example: Searching algorithms, sorting algorithms,
etc.
Google images
ï‚ą Example: Algorithm for checking a lamp
Google images
STRING MATCHING ALGORITHMS
ï‚ą Brute Force Algorithm
ï‚ą Karp-Rabin Algorithm
ï‚ą Boyer-Moore Algorithm
BRUTE FORCE ALGORITHM
ï‚ą Simplest string matching algorithm
ï‚ą Steps:
 Match the first character of the pattern with the first
character of the string
 If succeed, try to match the second character, and then
third and so on
BRUTE FORCE ALGORITHM
ï‚ą If hit a failure point, slide the pattern over one character
and try again
ï‚ą When a match is found, return its starting location
ï‚ą Example:
ï‚ą Given string “BCCATDOG”
ï‚ą Pattern to match is “CAT”
EXAMPLE
ALGORITHM FOR EXAMPLE
Step1: Match the first character of the pattern with the first character of the string
Step3: If hit a failure point, slide the pattern over one character and try again
Step2: If succeed, try to match the next character, and so on
Step4: When a match is found, return its starting location
Starting location for the pattern in the string is “3”
STRING MATCHING ALGORITHMS
APPLICATIONS
Besides Computer Science, String matching
algorithms have some other applications:
ï‚ą Detecting Plagiarism:
it is the process of locating instances of
plagiarism within a work or document
ï‚ą Bioinformatics
String algorithms are centrally important in
bioinformatics for dealing with sequence
information
CONT.
ï‚ą Molecular biology
Approximate matching of a search pattern to
a target text is a fundamental tool in
molecular biology
ï‚ą Computer Science
Exact string matching is more useful in
computer science
CONT.
ï‚ą Text Mining Research:
includes information extraction, topic
tracking, content summarization, information
visualization, question answering, concept
linkage, text classification, and text clustering
Google images
Google images
CONTACT ME
ï‚ą If you want the resources and further understanding
on this topic contact me via my email:
ï‚ą cmptrsntst@yahoo.com
ï‚ą Copy, cut do anything you want!!

String matching algorithms

  • 1.
  • 2.
    OUTLINE ï‚ą What isString? ï‚ą What is String Matching? ï‚ą Definition of Algorithm ï‚ą String Matching Algorithms ï‚ą String Matching Algorithms Applications
  • 3.
    WHAT IS STRING? ï‚ąIn computer programming, a string is traditionally a sequence of characters, either as constant or as some kind of variable ï‚ą E.g. ABCABDC or 1Ac35D Google images
  • 4.
    WHAT IS STRING? ï‚ąString may be applied in Bioinformatics to describe DNA strand composed of nitrogenous bases Google images
  • 5.
    WHAT IS STRINGMATCHING? ï‚ą String matching is finding occurrence(s) of a pattern string within another string or body of text ï‚ą E.g. We have a string “BCATDOG” and the pattern to be searched is “CAT”. Now finding “CAT” in the string “BCATDOG” is string matching
  • 6.
    WHAT IS STRINGMATCHING? ï‚ą Uses for the string matching include:  Finding a text in a document file or in a report  Used by different search engines like: Google Google images
  • 7.
  • 8.
    DEFINITION OF ALGORITHM ï‚ąAlgorithm is formula or set of rules followed for solving a problem. ï‚ą Example: Searching algorithms, sorting algorithms, etc. Google images
  • 9.
    ï‚ą Example: Algorithmfor checking a lamp Google images
  • 10.
    STRING MATCHING ALGORITHMS ï‚ąBrute Force Algorithm ï‚ą Karp-Rabin Algorithm ï‚ą Boyer-Moore Algorithm
  • 11.
    BRUTE FORCE ALGORITHM ï‚ąSimplest string matching algorithm ï‚ą Steps:  Match the first character of the pattern with the first character of the string  If succeed, try to match the second character, and then third and so on
  • 12.
    BRUTE FORCE ALGORITHM ï‚ąIf hit a failure point, slide the pattern over one character and try again ï‚ą When a match is found, return its starting location ï‚ą Example: ï‚ą Given string “BCCATDOG” ï‚ą Pattern to match is “CAT”
  • 13.
  • 14.
    ALGORITHM FOR EXAMPLE Step1:Match the first character of the pattern with the first character of the string Step3: If hit a failure point, slide the pattern over one character and try again Step2: If succeed, try to match the next character, and so on Step4: When a match is found, return its starting location Starting location for the pattern in the string is “3”
  • 15.
    STRING MATCHING ALGORITHMS APPLICATIONS BesidesComputer Science, String matching algorithms have some other applications: ï‚ą Detecting Plagiarism: it is the process of locating instances of plagiarism within a work or document ï‚ą Bioinformatics String algorithms are centrally important in bioinformatics for dealing with sequence information
  • 16.
    CONT. ï‚ą Molecular biology Approximatematching of a search pattern to a target text is a fundamental tool in molecular biology ï‚ą Computer Science Exact string matching is more useful in computer science
  • 17.
    CONT. ï‚ą Text MiningResearch: includes information extraction, topic tracking, content summarization, information visualization, question answering, concept linkage, text classification, and text clustering
  • 18.
  • 19.
  • 20.
    CONTACT ME ï‚ą Ifyou want the resources and further understanding on this topic contact me via my email: ï‚ą cmptrsntst@yahoo.com ï‚ą Copy, cut do anything you want!!