Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fast-median

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-median - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.travis.yml

2

package.json
{
"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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc