Skip to content

Instantly share code, notes, and snippets.

View abethcrane's full-sized avatar

Beth Crane ✨ abethcrane

View GitHub Profile
@abethcrane
abethcrane / palindromeTree.py
Created January 22, 2019 02:20
An overly-commented implementation of a Palindrome Tree in Python
debug_prints = False
class PalindromeTreeNode:
# Important to note: we don't use start_index and end_index much
# Because if this node is 'bb' and our string is 'abbacabbac' we'll see 'bb' twice
# So we use the length to calculate where in the full string the start index would be
# Each time we run across this node
# The start and end indices are useful for printing out this node though
start_index = 0
end_index = 0