Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Z-Algorithm for Linear-Time String Pattern Matching #7124

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

Merged
DenizAltunkapan merged 6 commits into TheAlgorithms:master from Utkarsh-patel26:master
Dec 14, 2025

Conversation

@Utkarsh-patel26
Copy link
Contributor

@Utkarsh-patel26 Utkarsh-patel26 commented Nov 26, 2025

  • [ x ] I have read CONTRIBUTING.md.
  • [ x ] This pull request is all my own work -- I have not plagiarized it.
  • [ x ] All filenames are in PascalCase.
  • [ x ] All functions and variable names follow Java naming conventions.
  • [ x ] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • [ x ] All new code is formatted with clang-format -i --style=file path/to/your/file.java

Copy link

codecov-commenter commented Nov 26, 2025
edited
Loading

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.88%. Comparing base (746457c) to head (1863193).

Files with missing lines Patch % Lines
...ain/java/com/thealgorithms/strings/ZAlgorithm.java 90.90% 2 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## master #7124 +/- ##
============================================
+ Coverage 78.87% 78.88% +0.01% 
- Complexity 6828 6837 +9 
============================================
 Files 766 767 +1 
 Lines 22607 22629 +22 
 Branches 4444 4450 +6 
============================================
+ Hits 17831 17851 +20 
- Misses 4064 4066 +2 
 Partials 712 712 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor Author

Adds the Z-Algorithm implementation and unit tests.
Includes zFunction, pattern search method, and Checkstyle-clean formatting.
Reference: https://en.wikipedia.org/wiki/Z-algorithm

Copy link
Member

@DenizAltunkapan DenizAltunkapan left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @Utkarsh-patel26

@DenizAltunkapan DenizAltunkapan merged commit bccaf97 into TheAlgorithms:master Dec 14, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@DenizAltunkapan DenizAltunkapan DenizAltunkapan approved these changes

@yanglbme yanglbme Awaiting requested review from yanglbme yanglbme is a code owner

@alxkm alxkm Awaiting requested review from alxkm alxkm is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /