ml-array-median
TypeScript icon, indicating that this package has built-in type declarations

1.1.6 • Public • Published

array-median

NPM version npm download

Get the median value in an array, this median use the Floyd-Rivest algorithm.

Thanks to mad-gooze for his median-quickselect lib.

Some benchmarks here.

Installation

$ npm install --save ml-array-median

Usage

import median from 'ml-array-median';

const result = median([1, 5, 3, 2, 4]);
// 3

License

MIT

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ml-array-median

    Weekly Downloads

    18,222

    Version

    1.1.6

    License

    MIT

    Unpacked Size

    5.04 kB

    Total Files

    8

    Last publish

    Collaborators

    • lpatiny
    • maasencioh
    • mljs-bot
    • stropitek
    • targos