search_in_array09
v1.0.1
Published
Search in array with binary method (log(n)) time complexity
Downloads
2
Readme
search-in-array
A Node.js package to search for an element in a sorted array using the binary search algorithm, with a time complexity of O(log n).
Installation
You can install the package via npm:
Usage
const searchInArr = require("search-in-array09");
let arr = [4, 5, 6, 8, 9, 13, 16, 22];
let m = 9;
console.log(searchInArr(arr, m)); // Output: Index of element 9 in the array