-
Notifications
You must be signed in to change notification settings - Fork 269
KMP classic algorithm and unit tests #125
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
Conversation
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.
It should be LPSArray = [ 0, 1, 0, 0, 1, 0 ]
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.
Hi @TheSTL the pattern had been updated to ABCABCACA. I feel this is a more intuitive example. I believe [ 0, 0, 0, 1, 2, 3, 4, 0, 1 ] to be the correct LPS, if there are any more queries or amendments you would like to be made, I’ll updage the PR as appropriate. Cheers.
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.
I think this example is more understandable from previous one to compute LPS.
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.
Thanks @jonathanmcchesney for PR 💯
Story: #124
Added KMP algorithm to classics folder, along with a series of unit tests to bring the file coverage up to 100%.
Updated file to keep in line with eslint rules.
Added comments and time complexity of the KMP pattern matching algorithm.
Added example use case in file preamble.