sort-x
v0.0.7
Published
JavaScript to achieve the ten common sorting algorithm library
Downloads
6
Readme
sort-x
Install
Npm: npm install --save sort-x
Yarn: yarn add sort-x
Umd:
<script src="path/sort-x/dist/index.js"></script>
sortX.bubble([3, 4, 2, 1]) // [1, 2, 3, 4]
sortX.selection([3, 4, 2, 1]) // [1, 2, 3, 4]
Demo
import {bubble} from 'sort-x';
// In your render...
bubble([3, 4, 2, 1]) // [1, 2, 3, 4]
import {selection} from 'sort-x';
// In your render...
selection([3, 4, 2, 1]) // [1, 2, 3, 4]
import {insertion} from 'sort-x';
// In your render...
insertion([3, 4, 2, 1]) // [1, 2, 3, 4]
ex:
Util
import {sorted} from 'sort-x';
sorted([3, 4, 2, 1]) // false
sorted([1, 2, 3, 4]) // true