@sanketm09/search_in_array
v1.1.0
Published
Search in array with binary method (log(n)) time complexity
Downloads
5
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:
npm install @sanketm09/search_in_array
Usage
const searchInArr = require("@sanketm09/search_in_array");
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