Closed Ramy-Badr-Ahmed closed 2 months ago
@Ramy-Badr-Ahmed, this pull request is being closed as none of the checkboxes have been marked. It is important that you go through the checklist and mark the ones relevant to this pull request. Please read the Contributing guidelines.
If you're facing any problem on how to mark a checkbox, please read the following instructions:
x
between the square bracket like so: [x]
NOTE: Only [x]
is supported so if you have put any other letter or symbol between the brackets, that will be marked as invalid. If that is the case then please open a new pull request with the appropriate changes.
Describe your change:
This pull request adds an implementation of the Suffix Tree data structure along with related functionalities, such as pattern searches.
Definition: The Suffix Tree is a compressed trie of all the suffixes of a given text used for for substring search and various other string-processing operations. (URL: Suffix Tree).
Implementation Details:
suffix_tree_node.py
: Defines theSuffixTreeNode
class, representing nodes in the suffix tree.build_suffix_tree.py
: Builds a suffix tree from the given text and apply pattern searche for a pattern in the built suffix tree.Example Usage:
example_usage.py
: Demonstrates how to use the Suffix Tree implementation with a predefined text and searches for various patterns.Unit Tests:
test_suffix_tree.py
: Validates the correctness of the Suffix Tree implementation, including tests for building the tree and searching for patterns.