A simple and lightweight npm package for performing binary search on sorted arrays in JavaScript.
- Efficiently search for elements in a sorted array.
- Easy to use and integrate.
- Lightweight and fast.
Install the package using npm:
npm i binary-search-package-219new
Import the package and use the binarySearch function:
const binarySearch = require('binary-search-package-219new');
// Example usage
const sortedArray = [1, 3, 5, 7, 9];
const target = 7;
const index = binarySearch(sortedArray, target);
console.log(index); // Output: 3
This project is licensed under the MIT License - see the LICENSE file for details.
Praveen Email: paru2192000@gmail.com GitHub: Praveen