skk-binsearch

1.0.2 • Public • Published

skk-binSearch

Build Status npm version
A small module named binSearch to find a specified data from a sorted Array.

Example

install

  npm install --save skk-binSearch

usage

  var binSearch = require('binSearch');

  var sortedArr = [1,3,6,7,12,54,67,123];

  // If not find specified data from arr, return null
  binSearch(sortedArr, 10); // null
  // If find specified data, return a array
  binSearch(sortedArr, 6);
  // [0:10, index:2, input:[1,3,6,7,12,54,67,123], count:2]

Package Sidebar

Install

npm i skk-binsearch

Weekly Downloads

8

Version

1.0.2

License

MIT

Unpacked Size

4.46 kB

Total Files

6

Last publish

Collaborators

  • softkaikai