Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Boyer–Moore string-search algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Definitions== {{float begin}} | A||N||P||A||N||M||A||N||- |- | P||A||N||-||-||-||-||-||- |- | -||P||A||N||-||-||-||-||- |- | -||-||P||A||N||-||-||-||- |- | -||-||-||P||A||N||-||-||- |- | -||-||-||-||P||A||N||-||- |- | -||-||-||-||-||P||A||N||- {{float end|caption=Alignments of pattern '''PAN''' to text '''ANPANMAN''',<br />from '''k=3''' to '''k=8'''. A match occurs at '''k=5'''.}} * '''''T''''' denotes the input text to be searched. Its length is '''n'''. * '''''P''''' denotes the string to be searched for, called the ''pattern''. Its length is '''m'''. * '''''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'', inclusive. * A ''prefix'' of ''S'' is a substring ''S''[1..''i''] for some ''i'' in range [1, ''l''], where ''l'' is the length of ''S''. * A ''suffix'' of ''S'' is a substring ''S''[''i''..''l''] for some ''i'' in range [1, ''l''], where ''l'' is the length of ''S''. * An ''alignment'' of ''P'' to ''T'' is an index ''k'' in ''T'' such that the last character of ''P'' is aligned with index ''k'' of ''T''. * A ''match'' or ''occurrence'' of ''P'' occurs at an alignment ''k'' if ''P'' is equivalent to ''T''[(''k''-''m''+1)..''k''].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)