the boyer-moore algorithm at firstwe might feel that it is always necessary to examine every character in in order to locate pattern as substring but this is not always the casefor the boyer-moore (bmpattern matching algorithmwhich we study in this sectioncan sometimes avoid comparisons between and sizable fraction of the characters in the only caveat is thatwhereas the brute-force algorithm can work even with potentially unbounded alphabetthe bm algorithm assumes the alphabet is of fixedfinite size it works the fastest when the alphabet is moderately sized and the pattern is relatively long thusthe bm algorithm is ideal for searching words in documents in this sectionwe describe simplified version of the original algorithm by boyer and moore the main idea of the bm algorithm is to improve the running time of the bruteforce algorithm by adding two potentially time-saving heuristics roughly statedthese heuristics are as followslooking-glass heuristicwhen testing possible placement of against tbegin the comparisons from the end of and move backward to the front of character-jump heuristicduring the testing of possible placement of against ta mismatch of text character [ic with the corresponding pattern character [jis handled as follows if is not contained anywhere in pthen shift completely past [ (for it cannot match any character in potherwiseshift until an occurrence of character in gets aligned with [