fast-binary-search
v1.0.4
Published
Pass your values inside binarySearch([1,2,3,4,5,6,7],6).
Downloads
28
Readme
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));
