insertion-sort-algorithm

1.0.3 • Public • Published

insertion-sort

A library of common dependency-free insertion sort algorithms.

Each insertion sort has the same time complexity and returns a sorted array. The original array remains untouched.

ascending order:

const insertionSort = require('insertion-sort-ascending');

insertionSort([5, 2, 4, 6, 1, 3])
  //returns [1, 2, 3, 4, 5, 6]

descending order:

const insertionSort = require('insertion-sort-descending');

insertionSort([5, 2, 4, 6, 1, 3])
  //returns [6, 5, 4, 3, 2, 1]

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.34latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.34
1.0.21
1.0.11
1.0.00

Package Sidebar

Install

npm i insertion-sort-algorithm

Weekly Downloads

6

Version

1.0.3

License

MIT

Last publish

Collaborators

  • mcasey8540