You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nathan Bergey aad7c55759 Readme: Extra note about approach 2 years ago
src Bm: Check edge conditions like empty strings for the search text 2 years ago
test Bm: Check edge conditions like empty strings for the search text 2 years ago
.gitignore git: ignore compled python files and pycache 2 years ago
Pipfile misc: Upgrade python version 4 years ago
README.md Readme: Extra note about approach 2 years ago
__init__.py misc: Add Boyer-Moore string search algorithm 5 years ago

README.md

Algorithm test

Nathan's version of BM search.

Given the skeleton in place in the code, and its type annotations, fill in a simplified version of the BM search algorithm.

It only returns the first occurrence of the pattern, and it only uses the "bad character" criteria from the algorithm. The lookup table is a sparse dictionary instead of a full alphabet like the C version.

Usage

$ python3 -m pip install pipenv

# Use virtualenv
$ PIPENV_VENV_IN_PROJECT=true pipenv shell

$ pipenv install --dev
  • Unittest
$ pipenv run unittest

References