Skip to content
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

[Add] KMP pattern matching algorithm. #60

Closed
k3tanyadav opened this issue Dec 26, 2024 · 1 comment
Closed

[Add] KMP pattern matching algorithm. #60

k3tanyadav opened this issue Dec 26, 2024 · 1 comment
Assignees

Comments

@k3tanyadav
Copy link
Contributor

I would like to add this function that returns a list containing the starting indices of all the occurrences of a pattern string (say p : size m) within a text string (say t : size n)

  1. Time Complexity : O(n+m)
  2. Space complexity : O(n+m), to calculate the longest prefix suffix (lps) array and also return all indices of occurrences.
@imsuraj675
Copy link
Owner

@k3tanyadav Go ahead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants