-
-
Notifications
You must be signed in to change notification settings - Fork 342
feat: Add Rabin–Karp string search algorithm in R #166
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
feat: Add Rabin–Karp string search algorithm in R #166
Conversation
sgindeed
commented
Oct 8, 2025
- Implemented the Rabin–Karp string search algorithm in R.
- Finds all occurrences of a pattern in a given text using rolling hash.
- Efficient for multiple pattern searches in large texts.
- Handles case-insensitive input.
- Prints the starting positions of all matches.
- Time Complexity: O(n + m) average, O(n*m) worst case.
- Space Complexity: O(1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the Rabin–Karp string search algorithm in R, which finds all occurrences of a pattern in text using a rolling hash technique for efficient pattern matching.
- Adds interactive user input for text and pattern
- Implements rolling hash computation with collision handling
- Provides case-insensitive pattern matching with position reporting
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Please check the comments, are they accurate? |
… char, pattern longer than text)
|
@siriak i have resolved the issues. please check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
siriak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!