mgechev / mgechev/javascript-algorithms
Update knuth-morris-pratt using ES6
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.8k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
Current Behavior:
The current implementation of the Knuth-Morris-Pratt (KMP) algorithm is written in a mix of ES5 and older JavaScript syntax. It consists of a function that efficiently searches for the position of the first occurrence of a specified value in a string.
Proposed Changes:
I propose updating the code to use ES6 features and syntax. This includes leveraging arrow functions, template literals, and other modern JavaScript constructs to enhance readability and maintainability.
Benefits:
- Improved code readability and maintainability due to the use of modern JavaScript syntax.
- Potential performance enhancements through optimized ES6 constructs.
Additional Information:
The updated code will maintain the functionality of the KMP algorithm while utilizing ES6 features to enhance its codebase. This update aims to align the algorithm with modern JavaScript practices.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the repository for the Knuth-Morris-Pratt implementation and inspect its current syntax before changing it. Modernize the implementation with ES6 syntax while preserving the algorithm's existing behavior; the work is done when the implementation is updated without changing its search results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100