@extra-array/insertion-sort
TypeScript icon, indicating that this package has built-in type declarations

2.9.41 • Public • Published

Arranges values in an order. 🏃 📼 📦 🌔 📒

Alternatives: sort, sort$.
Similar: sort, merge.
This is part of package extra-array.

array.insertionSort(x, [fc], [fm]);
// x:  an array
// fc: compare function (a, b)
// fm: map function (v, i, x)
const array = require('extra-array');

var x = [-2, -3, 1, 4];
array.insertionSort(x);
// [ -3, -2, 1, 4 ] (compares numbers)

array.insertionSort(x, (a, b) => Math.abs(a) - Math.abs(b));
// [ 1, -2, -3, 4 ]

array.insertionSort(x, null, v => Math.abs(v));
// [ 1, -2, -3, 4 ]

references

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.9.412latest

Version History

VersionDownloads (Last 7 Days)Published
2.9.412
2.9.400
2.9.390
2.9.380
2.9.371
2.9.360
2.9.350
2.9.340
2.9.330
2.9.320
2.9.310
2.9.300
2.9.120
2.9.110
2.9.100
2.9.90
2.9.80
2.9.70
2.9.60
2.9.50
2.9.40
2.9.30
2.9.20
2.9.10
2.9.00
2.8.760
2.8.750
2.8.740
2.8.730
2.8.720
2.8.710
2.8.700
2.8.690
2.8.670
2.8.660
2.8.650
2.8.640
2.8.630
2.8.620
2.8.610
2.8.600
2.8.590
2.8.580
2.8.570
2.8.560
2.8.550
2.8.540
2.8.530
2.8.520
2.8.510
2.8.500
2.8.490
2.8.480
2.8.470
2.8.460
2.8.450
2.8.440
2.8.430
2.8.420
2.8.410
2.8.400
2.8.390
2.8.380

Package Sidebar

Install

npm i @extra-array/insertion-sort

Weekly Downloads

2

Version

2.9.41

License

MIT

Unpacked Size

14.6 kB

Total Files

24

Last publish

Collaborators

  • wolfram77