Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5995669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:59:34+00:00 2026-05-22T23:59:34+00:00

I am facing issues in understanding Boyer Moore String Search algorithm. I am following

  • 0

I am facing issues in understanding Boyer Moore String Search algorithm.

I am following the following document. Link

I am not able to work out my way as to exactly what is the real meaning of delta1 and delta2 here, and how are they applying this to find string search algorithm.
Language looked little vague..

Kindly if anybody out there can help me out in understanding this, it would be really helpful.

Or, if you know of any other link or document available that is easy to understand, then please share.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:59:35+00:00Added an answer on May 22, 2026 at 11:59 pm

    The algorithm is based on a simple principle. Suppose that I’m trying to match a substring of length m. I’m going to first look at character at index m. If that character is not in my string, I know that the substring I want can’t start in characters at indices 1, 2, ... , m.

    If that character is in my string, I’ll assume that it is at the last place in my string that it can be. I’ll then jump back and start trying to match my string from that possible starting place. This piece of information is my first table.

    Once I start matching from the beginning of the substring, when I find a mismatch, I can’t just start from scratch. I could be partially through a match starting at a different point. For instance if I’m trying to match anand in ananand successfully match, anan, realize that the following a is not a d, but I’ve just matched an, and so I should jump back to trying to match my third character in my substring. This, "If I fail after matching x characters, I could be on the y’th character of a match" information is stored in the second table.

    Note that when I fail to match the second table knows how far along in a match I might be based on what I just matched. The first table knows how far back I might be based on the character that I just saw which I failed to match. You want to use the more pessimistic of those two pieces of information.

    With this in mind the algorithm works like this:

    start at beginning of string
    start at beginning of match
    while not at the end of the string:
        if match_position is 0:
            Jump ahead m characters
            Look at character, jump back based on table 1
            If match the first character:
                advance match position
            advance string position
        else if I match:
            if I reached the end of the match:
               FOUND MATCH - return
            else:
               advance string position and match position.
        else:
            pos1 = table1[ character I failed to match ]
            pos2 = table2[ how far into the match I am ]
            if pos1 < pos2:
                jump back pos1 in string
                set match position at beginning
            else:
                set match position to pos2
    FAILED TO MATCH
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing issues in decryption in Java. Following is the error encountered: javax.crypto.BadPaddingException:
I'm facing a real problem in understanding how to draw a variable diagram to
I am facing an application that uses hashing, but I cannot still figure out
Consider the following simplified objects and relationships: public class Job{ int JobId; String name;
I am facing issues with the special characters like ° and ® which represent
I am using NHibernate 2.0.1 and .NET I am facing issues with Lazy loading
I am facing some issues while serializing objects (I am using JBoss Drools, and
I am facing performance issues while reading/writing data from/to MS-Excel cells. I am using
Using WatiN, Im facing some issues with FireFox FF = new FireFox (http://www.google.com); ,
I am facing two issues when i try to connect to MQ which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.