Skip to content

Instantly share code, notes, and snippets.

View TACIXAT's full-sized avatar
🌴
Good life

TACIXAT TACIXAT

🌴
Good life
View GitHub Profile
@TACIXAT
TACIXAT / BoyerMooreStringSearch.py
Last active August 29, 2015 14:21 — forked from ameerkat/BoyerMooreStringSearch.py
BoyerMoore Python - Multiple Matches
# Boyer Moore String Search implementation in Python
# Ameer Ayoub <ameer.ayoub@gmail.com>
# Modified to return all indices - GG
# Generate the Bad Character Skip List
def generateBadCharShift(term):
skipList = {}
for i in range(0, len(term)-1):
skipList[term[i]] = len(term)-i-1
return skipList