JSPM

@superiqbal7/binarysearch

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q10481F
    • License ISC

    Binary search is a searching algorithm that works on sorted data. Binary searches check the middle value to see whether the desired value is greater or smaller than it. If the desired value is smaller, this algorithm can search the smaller parts, or it can search the bigger parts if the desired value is bigger.

    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