Skip to content

Updated strstr.cc #24

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
merged 1 commit into from
Aug 30, 2021
Merged

Updated strstr.cc #24

merged 1 commit into from
Aug 30, 2021

Conversation

pratikgl
Copy link
Contributor

The previously implemented method was using an STL function. I have Implemented Rabin-Karp Algorithm which works in O(N). This algorithm is based on the concept of string hashing. More details can be found here

Implemented Rabin-Karp Algorithm for 0028_implement_strstr
@pratikgl
Copy link
Contributor Author

I have also implemented KMP algorithm for this problem.

I was thinking if we should create another file like strstr_kmp.cc and add the implementation there or we can just add it here and comment it out.

@begeekmyfriend
Copy link
Owner

You solution is excellent for me. Sorry for my late reply.

@begeekmyfriend begeekmyfriend merged commit dcb8bba into begeekmyfriend:master Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants