Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 473 Bytes

README.md

File metadata and controls

16 lines (11 loc) · 473 Bytes

Horspool_algorithm

string matching algorithm

The Horspool algorithm checks first the text character aligned with the last pattern character. If it doesn’t match, move (shift) the pattern forward until there is a match. The length of the shift is determined by the shift table

enter the string

enter the pattern

it gives position of the first occurance of the pattern in the string. non zero-

uncomment another print inside shift funtion to see the shift table