Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 291 Bytes

README.md

File metadata and controls

25 lines (15 loc) · 291 Bytes

binary-search-js

This is a javascript library to perform binary search on a sorted array.

Installation

npm install bsearch.js

Usage

const bs = require("bsearch.js")

arr = [1,2,3,4,5,6,7,8]

console.log(bs(arr,3))
//2

console.log(bs(arr,1000))
//-1