▁which ▁takes ▁care ▁of ▁case ▁ 1 , ▁is ▁analog ous ▁to ▁// ▁the ▁K MP ▁table , ▁adapted ▁for ▁a ▁' back wards ' ▁scan ▁order ▁with ▁the ▁// ▁additional ▁restriction ▁that ▁the ▁sub strings ▁it ▁cons iders ▁as ▁// ▁potential ▁prefix es ▁are ▁all ▁suffix es . ▁In ▁the ▁worst ▁case ▁scenario ▁// ▁pat ▁consists ▁of ▁the ▁same ▁letter ▁repeated , ▁so ▁every ▁suffix ▁is ▁// ▁a ▁prefix . ▁This ▁loop ▁alone ▁is ▁not ▁sufficient , ▁however : ▁// ▁Suppose ▁that ▁pat ▁is ▁" AB Y X C DB Y X ", ▁and ▁text ▁is ▁" ..... AB Y X C DE Y X ". ▁// ▁We ▁will ▁match ▁X , ▁Y , ▁and ▁find ▁B ▁!= ▁E . ▁There ▁is ▁no ▁prefix ▁of ▁pat ▁// ▁in ▁the ▁suffix ▁" Y X ", ▁so ▁the ▁first ▁loop ▁tells ▁us ▁to ▁skip ▁forward ▁// ▁by ▁ 9 ▁characters . ▁// ▁Although ▁super f icial ly ▁similar ▁to ▁the ▁K MP ▁table , ▁the ▁K MP ▁table ▁// ▁re lies ▁on ▁information ▁about ▁the ▁beginning ▁of ▁the ▁partial ▁match ▁// ▁that ▁the ▁B M ▁algorithm ▁does ▁not ▁have . ▁// ▁// ▁The ▁second ▁loop ▁addresses ▁case ▁ 2 . ▁Since ▁suffix _ length ▁may ▁not ▁be ▁// ▁unique , ▁we ▁want ▁to ▁take ▁the ▁minimum ▁value , ▁which ▁will ▁tell ▁us ▁// ▁how ▁far ▁away ▁the ▁closest ▁potential ▁match ▁is . ▁void ▁make _ delta 2 ( pt rd iff _ t ▁* delta 2 , ▁uint 8 _ t ▁* pat ,