Page 148 - Data Structures Handout_Neat
P. 148

11.3.5  Boyer-Moore Algorithm

                       The Boyer-Moore algorithm is one of the most efficient string searching algorithms.

               It preprocesses the pattern to create two tables: the bad character rule and the good suffix
               rule, which allow the algorithm to skip sections of the text. This often results in sublinear time

               complexity in practice, making it highly effective for large texts.

                       Example in C++ (Bad Character Rule):





































                                                            148
   143   144   145   146   147   148   149   150   151   152   153