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

2.9.60 • Public • Published

Arranges values in an order. 🏃 📼 📦 🌔 📒

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

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

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

x;
// [ -3, -2, 1, 4 ]

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

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

references

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.9.605latest

Version History

VersionDownloads (Last 7 Days)Published
2.9.605
2.9.591
2.9.581
2.9.571
2.9.562
2.9.551
2.9.541
2.9.531
2.9.521
2.9.511
2.9.501
2.9.491
2.9.481
2.9.471
2.9.461
2.9.451
2.9.441
2.9.434
2.9.421
2.9.411
2.9.402
2.9.391
2.9.381
2.9.372
2.9.361
2.9.351
2.9.341
2.9.331
2.9.322
2.9.311
2.9.301
2.9.121
2.9.111
2.9.101
2.9.91
2.9.81
2.9.71
2.9.61
2.9.51
2.9.41
2.9.31
2.9.21
2.9.11
2.9.01
2.8.761
2.8.751
2.8.741
2.8.733
2.8.721
2.8.711
2.8.701
2.8.691
2.8.671
2.8.661
2.8.651
2.8.641
2.8.631
2.8.621
2.8.611
2.8.601
2.8.591
2.8.581
2.8.572
2.8.561
2.8.551
2.8.541
2.8.532
2.8.521
2.8.511
2.8.501
2.8.491
2.8.481
2.8.471
2.8.461
2.8.451
2.8.441
2.8.431
2.8.421
2.8.411
2.8.401
2.8.392
2.8.381
2.8.371
2.8.361
2.8.351

Package Sidebar

Install

npm i @extra-array/bubble-sort-update

Weekly Downloads

7

Version

2.9.60

License

MIT

Unpacked Size

12.6 kB

Total Files

19

Last publish

Collaborators

  • wolfram77