Package Exports
- @andreas-hum/arraysorter
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@andreas-hum/arraysorter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@andreas-hum/arraysorter

A package containing many different sorting algorithms for sorting arrays or key pair arrays.
Getting Started
Prerequisites
The latest version of npm or yarnInstalling
npm i @andreas-hum/arraysorteryarn add @andreas-hum/arraysorterUsage
const sort = require('.arraysorter');
let sortedArr = sort.introSort([2,4,1,3,5]);
console.log(sortedArr);
//Output [1,2,3,4,5]
let sortedArrAsc = sort.cocktailSort([2,4,1,3,5],'asc');
console.log(sortedArrAsc);
//Output [5,4,3,2,1]
let keySort = sort.mergeSort([{ 'key': 'foo' }, { 'key': 'bar' }], 'des', 'key')
console.log(keySort);
//Output [{ 'key': 'bar' },{ 'key': 'foo' }];List of current sorting algorithms implemented: key+ means that the algorithm can sort via keys
Comparison sorts
- Bubble - key+
- Bingo - key+
- Comb - key+
- Cycle - key+
- Cocktail - key+
- Gnome - key+
- (max) Heap - key+
- (min) Heap - key+
- Insertion
- (Binary) Insertion
- Introspective
- Merge key+
- Odd even
- Patience
- Quick
- (double) Selection
- Selection
- Shell
- Tim
Non-comparison sorts
- Bucket
- Counting
- Flash
- (LSD) Radix
- Pigeonhole
Other
- Bogo
- Gravity
- Stooge
List of current helper functions implemented
- Binary search
- Execution time for functions or sorting methods
- Get max element index
- Get position of a number
- (min) Heapify
- (max) Heapify
- Partition operation
- Random array creater
- Swap array elements
References
- https://en.wikipedia.org/wiki/Sorting_algorithm
- https://rosettacode.org/wiki/Category:Sorting_Algorithms
- https://www.geeksforgeeks.org/sorting-algorithms/
- https://www.cs.cmu.edu/~adamchik/15-121/lectures/Sorting%20Algorithms/sorting.html
- https://www.w3resource.com/index.php
- https://www.researchgate.net/publication/330084245_Improved_Double_Selection_Sort_using_Algorithm
- https://jeffreystedfast.blogspot.com/2007/02/binary-insertion-sort.html
- https://github.com/MattMoony/pretty-sorting-algorithms
- http://en.wikipedia.org/wiki/Timsort
- https://github.com/bellbind/stepbystep-timsort
Author
- Andreas Hummelmose - Andreas-Hum
License
This project is licensed under the ISC License - see the LICENSE.md file for details