Title: [OTHER] · Issue #7442 · TheAlgorithms/Java · GitHub
Open Graph Title: [OTHER] · Issue #7442 · TheAlgorithms/Java
X Title: [OTHER] · Issue #7442 · TheAlgorithms/Java
Description: What would you like to share? What would you like to Propose? Add an implementation of the Aho-Corasick string matching algorithm. Problem statement: Given a text and a list of patterns, find all occurrences of all patterns in the text e...
Open Graph Description: What would you like to share? What would you like to Propose? Add an implementation of the Aho-Corasick string matching algorithm. Problem statement: Given a text and a list of patterns, find all o...
X Description: What would you like to share? What would you like to Propose? Add an implementation of the Aho-Corasick string matching algorithm. Problem statement: Given a text and a list of patterns, find all o...
Opengraph URL: https://github.com/TheAlgorithms/Java/issues/7442
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[OTHER]","articleBody":"### What would you like to share?\n\n### What would you like to Propose?\n\nAdd an implementation of the Aho-Corasick string matching algorithm.\n\nProblem statement: Given a text and a list of patterns, find all occurrences of all patterns in the text efficiently. This algorithm is useful when multiple keywords need to be searched in a single pass.\n\n### Issue details\n\nThe implementation can be added under the string/search-related package and should include unit tests.\n\nExpected behavior examples:\n\nInput:\n- text: `ahishers`\n- patterns: `[\"he\", \"she\", \"his\", \"hers\"]`\n\nExpected matches:\n- `his` at index `1`\n- `she` at index `3`\n- `he` at index `4`\n- `hers` at index `4`\n\nSuggested implementation details:\n- Build a trie from all patterns.\n- Compute failure links using BFS.\n- Traverse the input text once and report matched patterns.\n- Expected time complexity: `O(n + m + z)`, where `n` is the text length, `m` is the total length of all patterns, and `z` is the number of matches.\n- Expected space complexity: `O(m)`.\n\n### Additional Information\n\nThis would be a useful addition for educational coverage of multi-pattern string matching algorithms.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/wdlpazlmj","@type":"Person","name":"wdlpazlmj"},"datePublished":"2026-06-01T03:37:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/7442/Java/issues/7442"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f03ab6b7-3701-2d28-d919-e53a767f11c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 92C0:184E5C:1F1D89:2B0C08:6A630051 |
| html-safe-nonce | f57c42224d5464a71c70a0c16d44370fe622487a5ce6869e2a6864e426725502 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkMwOjE4NEU1QzoxRjFEODk6MkIwQzA4OjZBNjMwMDUxIiwidmlzaXRvcl9pZCI6Ijg4MTA5MjMzNTI3OTI0MzI3MjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 66b145c81da9b130c40f9b66943592913db498bc80cadd57e46c6dd8eababcb4 |
| hovercard-subject-tag | issue:4560121431 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TheAlgorithms/Java/7442/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b6bee51b6740ca70dc360499b6cf50547cf0dff013ff6670b3a2c4666f33157f/TheAlgorithms/Java/issues/7442 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b6bee51b6740ca70dc360499b6cf50547cf0dff013ff6670b3a2c4666f33157f/TheAlgorithms/Java/issues/7442 |
| og:image:alt | What would you like to share? What would you like to Propose? Add an implementation of the Aho-Corasick string matching algorithm. Problem statement: Given a text and a list of patterns, find all o... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wdlpazlmj |
| hostname | github.com |
| expected-hostname | github.com |
| None | 14517cd57568049be7ed25bfe9708f10d1e36b7254adfd920dfb9d44bcc71c41 |
| turbo-cache-control | no-preview |
| go-import | github.com/TheAlgorithms/Java git https://github.com/TheAlgorithms/Java.git |
| octolytics-dimension-user_id | 20487725 |
| octolytics-dimension-user_login | TheAlgorithms |
| octolytics-dimension-repository_id | 63477660 |
| octolytics-dimension-repository_nwo | TheAlgorithms/Java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 63477660 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/Java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b2ed33e3827bc186c45c037f9274b5493aaca4c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width