1.0.4 • Published 4 years ago
fast-binary-search v1.0.4
Pass your values inside binarySearch(1,2,3,4,5,6,7,6).
Here,
1,2,3,4,5,6,7 is your main array.
6 is the value you are looking for.
If value is not available inside the array it will return you -1.
Otherwise it will return array position index.
Time complexity = O log(n)
Searching algorithm = Binary search
Use:
npm install fast-binary-search
const binarySearch = require('fast-binary-search');
console.log(binarySearch.binarySearch(1,2,3,4,5,6,7,8,9,9));