search-ray
v1.0.1
Published
searching algorithms for arrays
Downloads
3
Maintainers
Readme
search-ray
search-ray is javascript library to search for item in array and it will return index of the found element.
Installation
Use the package manager npm to install search-ray.
npm install search-ray
Usage
Program for linear search
const search = require('search-ray');
console.log(search.linearSearch([1,2,3,5],5)) // [3]
Program for binary search
const search = require('search-ray');
console.log(search.binarySearch([1,2,3,5],5)) // 3
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.