Skip to content
Suffix tree for string searching
Python
Find file
Pull request Compare This branch is 5 commits behind kvh:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE
README.md
suffix_tree.py
test.txt
test_suffix_tree.py

README.md

Suffix Trees in Python

Based off of Mark Nelson's C++ implementation of Ukkonen's algorithm. Ukkonen's algorithm gives a O(n) + O(k) contruction time for a suffix tree, where n is the length of the string and k is the size of the alphabet of that string. Ukkonen's is an online algorithm, processing the input sequentially and producing a valid suffix tree at each character.

How to use

string = "I need to be searched!"
tree = SuffixTree(string)
index_of_need = stree.find_substring("need")
Something went wrong with that request. Please try again.