pydatastructs
pydatastructs copied to clipboard
feat: Add Manacher's Algorithm for finding the longest palindromic substring
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
manacherfunction inpydatastructs.strings.algorithms. - Added unit tests for the
manacherfunction intest_algorithms.py. - Updated the
__all__list to includemanacherfor public API access.
Fixes: #586
@Kishan-Ved Pls review this PR
@czgdp1807 It looks like the windows CI is failing from many recent PRs.
@Kishan-Ved Make the changes but still window CI still failed. Can you pls give me idea why it is failing...
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Please upload report for BASE (
main@f4c1677). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@
## main #587 +/- ##
========================================
Coverage ? 97.359%
========================================
Files ? 36
Lines ? 4469
Branches ? 0
========================================
Hits ? 4351
Misses ? 118
Partials ? 0
| Files with missing lines | Coverage Δ | |
|---|---|---|
| pydatastructs/strings/__init__.py | 100.000% <ø> (ø) |
|
| pydatastructs/strings/algorithms.py | 100.000% <100.000%> (ø) |
🚀 New features to boost your workflow:
- ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.