Skip to content

Add doctests for the boyer_moore_search algorithm. #12769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update boyer_moore_search.py
  • Loading branch information
MaximSmolskiy authored Jun 2, 2025
commit 1a5616c830d136626378c44979d84e3ab39c719e
5 changes: 1 addition & 4 deletions strings/boyer_moore_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@
m=length of pattern string
"""


class BoyerMooreSearch:
"""
Example usage:

text = "ABAABA"
pattern = "AB"
bms = BoyerMooreSearch(text, pattern)
bms = BoyerMooreSearch(text="ABAABA", pattern="AB")
positions = bms.bad_character_heuristic()

where 'positions' contain the locations where the pattern was matched.
Expand Down