npm.io
1.0.1 • Published 5 years ago

search-ray

Licence
ISC
Version
1.0.1
Deps
0
Size
2 kB
Vulns
0
Weekly
0

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.

Sponsor this project

Support via PayPal

Keywords