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

feat: Add Manacher's Algorithm for finding the longest palindromic substring #587

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

asmit27rai
Copy link

Description

This PR adds Manacher's Algorithm to the pydatastructs.strings.algorithms module. The algorithm efficiently finds the longest palindromic substring in a given string in O(n) time, where n is the length of the string.

Changes

  • Implemented the manacher function in pydatastructs.strings.algorithms.
  • Added unit tests for the manacher function in test_algorithms.py.
  • Updated the __all__ list to include manacher for public API access.

Fixes: #586

…bstring

- Implemented `manacher` function in `pydatastructs.strings.algorithms`.
- Added unit tests for `manacher` in `test_algorithms.py`.
- Updated `__all__` list to include `manacher` for public API access.

Manacher's Algorithm provides an efficient O(n) solution for finding the longest palindromic substring in a given string. This addition enhances the string processing capabilities of the library.
@asmit27rai
Copy link
Author

@Kishan-Ved Pls review this PR

Copy link
Contributor

@Kishan-Ved Kishan-Ved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the .pyd files. These are binary files.

Doing this should also rerun the tests, they should pass.

@Kishan-Ved
Copy link
Contributor

@czgdp1807 It looks like the windows CI is failing from many recent PRs.

@asmit27rai
Copy link
Author

@Kishan-Ved Make the changes but still window CI still failed.
Can you pls give me idea why it is failing...

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.

Manacher's Algorithm
2 participants