Java
Java copied to clipboard
Rabin karp algo
- [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
Codecov Report
Attention: Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
Project coverage is 52.13%. Comparing base (
648572a) to head (1f73373).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...ithms/strings/PatternSearchUsingRabinKarpAlgo.java | 96.15% | 0 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #5425 +/- ##
============================================
+ Coverage 52.05% 52.13% +0.07%
- Complexity 3240 3249 +9
============================================
Files 524 525 +1
Lines 15181 15207 +26
Branches 2888 2897 +9
============================================
+ Hits 7903 7928 +25
Misses 6955 6955
- Partials 323 324 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hey regarding the previous comment on my previous closed PR @alxkm , my implementation improves the Rabin-Karp algorithm by more modularity with well-structured methods, making the code more readable and maintainable. It includes input error handlings to prevent runtime errors from edge cases like empty strings.. I faced small small errors after committing so there are more commits :)
There are already two implementations:
👀why there are two implementations then? just asking 😀 is it allowed? if yes, make this the third one :)
👀why there are two implementations then?
No idea.
is it allowed?
No.
EDIT: Since you have a fresh knowledge about Rabin-Karp algorithm feel free to take care of this duplication, i.e.:
- select the better one,
- tidy-up it a bit,
- add some test cases.
Yeah, you can improve the existing algo, I can not add this algo, it already exists.