# array-sorting-algorithms

> A package which implements many different sorting algorithms for sorting arrays

Latest version **1.0.0** (published 2020-08-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install array-sorting-algorithms
pnpm add array-sorting-algorithms
yarn add array-sorting-algorithms
bun add array-sorting-algorithms
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-08-11 |
| First published | 2020-08-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 62.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andreas Hummelmose |
| Maintainers | andreas-h |
| Keywords | sorting, sorting-algorithms, sorting algorithms, array sorting, array, algorithm, merge, bubble, insertion, selection, comb, quick, shell, heap, intro, introspective, counting, bucket, pigeonhole, cycle, cocktail, gnome, patience, bogo, radix, odd-even, bingo, double-selection, stooge, binary-insertion, gravity, flash, tim |

## Links

- npm: https://www.npmjs.com/package/array-sorting-algorithms
- Repository: https://github.com/Andreas-Hum/array-sort-algorithms
- Homepage: https://github.com/Andreas-Hum/array-sort-algorithms#readme
- Issues: https://github.com/Andreas-Hum/array-sort-algorithms/issues
- npm.io page: https://npm.io/package/array-sorting-algorithms

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-08-11

## README

# array-sorting-algorithms

A package containing many different sorting algorithms for sorting arrays.

## Getting Started

### Prerequisites

```
The latest version of npm or yarn
```

### Installing

```
npm i array-sorts
```

```
yarn add array-sorts
```

## Usage

```js
const sort = require('.array-sorting-algorithms');

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 stringSort = sort.mergeSort(['b','c','a']);
console.log(stringSort);
//Output ['a','b','c'];
```

## List of current sorting algorithms implemented

+ Comparison sorts
  - Bubble
  - Bingo
  - Comb
  - Cycle
  - Cocktail
  - Gnome
  - (max) Heap
  - (min) Heap
  - Insertion
  - (Binary) Insertion
  - Introspective
  - Merge
  - 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](https://github.com/Andreas-Hum)

## License

This project is licensed under the ISC License - see the [LICENSE.md](LICENSE.md) file for details

---
_Source: https://npm.io/package/array-sorting-algorithms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
