▁the ▁pre process ▁step ▁to ▁skip ▁sections ▁of ▁the ▁text , ▁resulting ▁in ▁a ▁lower ▁constant ▁factor ▁than ▁many ▁other ▁string ▁search ▁algorithms . ▁In ▁general , ▁the ▁algorithm ▁runs ▁faster ▁as ▁the ▁pattern ▁length ▁increases . ▁The ▁key ▁features ▁of ▁the ▁algorithm ▁are ▁to ▁match ▁on ▁the ▁tail ▁of ▁the ▁pattern ▁rather ▁than ▁the ▁head , ▁and ▁to ▁skip ▁along ▁the ▁text ▁in ▁j umps ▁of ▁multiple ▁characters ▁rather ▁than ▁searching ▁every ▁single ▁character ▁in ▁the ▁text . ▁ ▁De fin itions ▁Al ign ments ▁of ▁pattern ▁P AN ▁to ▁text ▁AN P AN MAN , ▁from ▁k = 3 ▁to ▁k = 8 . ▁A ▁match ▁occurs ▁at ▁k = 5 . ▁ ▁S [ i ] ▁denotes ▁the ▁character ▁at ▁index ▁i ▁of ▁string ▁S , ▁counting ▁from ▁ 1 . ▁ ▁S [ i .. j ] ▁denotes ▁the ▁substring ▁of ▁string ▁S ▁starting ▁at ▁index ▁i ▁and ▁ending ▁at ▁j , ▁inclus ive . ▁ ▁A ▁prefix ▁of ▁S ▁is ▁a ▁substring ▁S [ 1 .. i ] ▁for ▁some ▁i ▁in ▁range ▁[ 1 , ▁n ], ▁where ▁n ▁is ▁the ▁length ▁of ▁S . ▁ ▁A ▁suffix ▁of ▁S ▁is ▁a ▁substring ▁S [ i .. n ] ▁for ▁some ▁i ▁in ▁range ▁[ 1 , ▁n ], ▁where ▁n ▁is ▁the ▁length ▁of ▁S . ▁ ▁The ▁string ▁to ▁be ▁searched ▁for ▁is ▁called ▁the ▁pattern ▁and ▁is ▁denoted ▁by ▁P . ▁Its ▁length ▁is ▁n . ▁ ▁The ▁string ▁being ▁searched ▁in ▁is ▁called