@bemoje/arr-partition-index

1.0.1 • Public • Published

@bemoje/arr-partition-index

Linear-time Partitioning. Runtime: O(n). Chooses a pivot and re-arrages the array so that everything on the left is <= pivot and everything on the right is > pivot

Version

NPM version

Travis CI

dependencies

Dependencies

dependencies

Stats

NPM downloads Forks

Donate

Buy Me A Beer donate button PayPal donate button

Installation

npm install @bemoje/arr-partition-index
npm install --save @bemoje/arr-partition-index
npm install --save-dev @bemoje/arr-partition-index

Usage

import arrPartitionIndex from '@bemoje/arr-partition-index'

const arr = [1, 2, 3, 4]

arrPartitionIndex(arr, 1, 2)
//=> 1

Tests

Uses Jest to test module functionality. Run tests to get coverage details.

npm run test

API

arrPartitionIndex

Linear-time Partitioning. Runtime: O(n). Chooses a pivot and re-arrages the array so that everything on the left is <= pivot and everything on the right is > pivot

Parameters
Returns

number pivot index

Package Sidebar

Install

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

9.22 kB

Total Files

5

Last publish

Collaborators

  • bemoje