fast-median
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "fast-median", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Find median of an array in amortized linear time", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -1,2 +0,37 @@ | ||
# fast-median | ||
npm package for finding the median element in an array in average case linear time | ||
## fast-median | ||
Find median element in an arary of numbers | ||
Uses a randomized quickselect to achieve O(n) average case time complexity | ||
[![Build Status](https://travis-ci.org/gm758/fast-median.svg?branch=master)](https://travis-ci.org/gm758/fast-median) | ||
## Install | ||
```bash | ||
$ npm install fast-median | ||
``` | ||
## Usage | ||
```js | ||
import median from 'fast-median' | ||
median([10, 20, 30, 40]) | ||
// 25 | ||
median([10, 20, 30, 40, 50]) | ||
// 30 | ||
median([1]) | ||
// 1 | ||
``` | ||
## API | ||
```js | ||
median :: number a => [a] -> a | ||
median(numbers) | ||
``` | ||
__Arguments__ | ||
* `numbers` - An array of numbers | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6046
9
38