1.1.3 • Published 9 years ago

m-sorted-array v1.1.3

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
9 years ago

m-sorted-array NPM version Build Status Dependency Status Coverage percentage

Implementation of insert, find and remove of sorted array

Install

$ npm install --save m-sorted-array

Usage

var SortedArray = require('m-sorted-array');

var SortedArray = require('./lib');
var sortedArray = SortedArray([8, 3, 2, 9, 1]);
console.log(sortedArray.array); // [1, 2, 3, 8, 9]

sortedArray.insert(5);
console.log(sortedArray.array); // [1, 2, 3, 5, 8, 9]

console.log(sortedArray.find(4)); // -1

var strict = false;
console.log(sortedArray.find(4, strict)); // 3

sortedArray.remove(2); // true
sortedArray.remove(2); // false
console.log(sortedArray.array); // [1, 3, 5, 8, 9]

License

Apache-2.0 © Mieszko4

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago