Package Exports
- @superiqbal7/binarysearch
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@superiqbal7/binarysearch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Binary Search.
Installation
npm install @superiqbal7/binarysearch --save
Synopsis
Given a sorted array arr[] of n elements, search a given element x in arr[].:
const binarySearch = require("@superiqbal7/binarysearch");
binarySearch([1, 2, 3, 4], 4); // Prints '4'
binarySearch([1, 2, 3, 4], 5); // Prints '-1'
License
MIT