TheAlgorithms / Java

All Algorithms implemented in Java
MIT License
59.6k stars 19.22k forks source link

[FEATURE REQUEST] Aho–Corasick algorithm #4464

Closed Prabhat-Kumar-42 closed 1 year ago

Prabhat-Kumar-42 commented 1 year ago

What would you like to Propose?

Adding Aho–Corasick algorithm.

wiki - https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm

Summary (From wiki): The Aho–Corasick algorithm is a string-searching algorithm. It is a kind of dictionary-matching algorithm that locates elements of a finite set of strings (the "dictionary") within an input text. It matches all strings simultaneously. The complexity of the algorithm is linear in the length of the strings plus the length of the searched text plus the number of output matches. Note that because all matches are found, there can be a quadratic number of matches if every substring matches (e.g. dictionary = a, aa, aaa, aaaa and input string is aaaa).

Issue details

Brief details about Aho-Corasick algorithm can be found by landing on above wiki page.

Summary of requirements to understand and implement it -

Additional Information

No response

Prabhat-Kumar-42 commented 1 year ago

Hello, I have created a pull request regarding this. Please take a look. Let me know if there's any issue. I will solve it asap. Thank You !! :)

vil02 commented 1 year ago

Closed by #4465.