https://github.com/chausme/simple-binary-search
Simple binary search algorithm implementation
https://github.com/chausme/simple-binary-search
algorithm algorithms search
Last synced: 8 months ago
JSON representation
Simple binary search algorithm implementation
- Host: GitHub
- URL: https://github.com/chausme/simple-binary-search
- Owner: chausme
- License: mit
- Created: 2022-12-25T05:54:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-19T10:54:33.000Z (almost 3 years ago)
- Last Synced: 2024-08-10T10:57:55.588Z (over 1 year ago)
- Topics: algorithm, algorithms, search
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Simple Binary Search
[](https://www.npmjs.com/package/simple-binary-search)
Simple binary search algorithm implementation
# Install
```bash
npm install simple-binary-search
yarn add simple-binary-search
```
# Usage
```javascript
import binarySearch from 'simple-binary-search';
binarySearch([1, 3, 6, 10, 24], 3); // 1
binarySearch([1, 3, 6, 10, 24], 33); // -1
```