https://github.com/evandrolg/find-by-words
A solution for finding words started by a string. It works well on both front-end and back-end.
https://github.com/evandrolg/find-by-words
algorithm binary-search performace search
Last synced: 4 months ago
JSON representation
A solution for finding words started by a string. It works well on both front-end and back-end.
- Host: GitHub
- URL: https://github.com/evandrolg/find-by-words
- Owner: EvandroLG
- License: mit
- Created: 2017-02-05T23:47:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T00:25:14.000Z (over 8 years ago)
- Last Synced: 2025-06-09T13:55:43.155Z (4 months ago)
- Topics: algorithm, binary-search, performace, search
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# find-by-words
A solution for finding words started by a string. It works well on both front-end and back-end.## How does it work?
This implementation is inspired by the [binary search algorithm](https://en.wikipedia.org/wiki/Binary_search_algorithm). Like the famous algorithm, this solution uses the divide-and-conquer strategy and when it finds the first item, it searches for items on the left and right, stopping the loop when the first attempt fails.## Installation
```shell
npm install find-by-words
```## Parameters
* **wordsList**Array
* **word**String
* **caseSensitive**Boolean
(false
by default)## How to use?
```js
findByWords(['python', 'ruby', 'java', 'javascript', 'lua'], 'Java', true);
// output: ['java', 'javascript']
```