String Algo – 1

Finding if a substring is present in a string or not.

There are multiple method.

  1. Brute Force
  2. Robin Karp Algorithm:
    Resource:  Video   Theory  Code
    The Rabin–Karp algorithm is inferior for single pattern searching to Knuth–Morris–Pratt algorithm, Boyer–Moore string search algorithm and other faster single pattern string searching algorithms because of its slow worst case behavior. However, it is an algorithm of choice for multiple pattern search.That is, if we want to find any of a large number, say k, fixed length patterns in a text, we can create a simple variant of the Rabin–Karp algorithm that uses a Bloom filteror a set data structure to check whether the hash of a given string belongs to a set of hash values of patterns we are looking for.
  3. Z-Algorithm:
    Resource: Video: 1**2 Code: 1
  4.  Knuth–Morris–Pratt(KMP)
    Resource: Video: 1 , 2 Code: 1
  5. Boyer Moore
  6. Algo Corasik
  7. Finite State Automata



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s