Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a suffix array for a string in python #276

Merged
merged 4 commits into from
Oct 4, 2020

Conversation

Double77x
Copy link
Contributor

Added a function which takes a string and then returns the suffix array for the given string in python. Located in the Arrays folder.
#272

Returns the suffix array for a given string in python
Returns suffix array for a given string in python
@Kanhakhatri065
Copy link
Collaborator

This one is a naive approach. Can you iimplement an efficient approach?

@Double77x
Copy link
Contributor Author

Efficient in what nature? Take a list of strings and return the full list of arrays for the given strings?

@Kanhakhatri065
Copy link
Collaborator

Efficient in terms of time complexity.

Created a secondary function "ComplexSuffixArray" which, when timed, is up to 50% faster than the naive approach on some given strings. It uses Itertools and zip to avoid iterating over sequences of indices, instead iterating over the elements directly.
@Kanhakhatri065 Kanhakhatri065 merged commit 3922a3f into ephremdeme:master Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants