Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abranhe/quick-srt
Quick Sort Algorithm Implementation
https://github.com/abranhe/quick-srt
algorithm quicksort sorting-algorithms
Last synced: 5 days ago
JSON representation
Quick Sort Algorithm Implementation
- Host: GitHub
- URL: https://github.com/abranhe/quick-srt
- Owner: abranhe
- License: mit
- Created: 2018-08-20T22:44:40.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T22:47:41.000Z (about 6 years ago)
- Last Synced: 2024-10-12T12:14:55.233Z (about 1 month ago)
- Topics: algorithm, quicksort, sorting-algorithms
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
quick-srt
: Quick Sort Algorithm Implementation# Overview
Quicksort is an efficient sorting algorithm, serving as a systematic method for placing the elements of an array in order. Developed by Tony Hoare in 1959, and published in 1961, it is still a commonly used algorithm for sorting. When implemented well, it can be about two or three times faster than its main competitors, merge sort and heapsort.
[Read More ...](https://en.wikipedia.org/wiki/Quicksort)
# Install
```
npm install quick-srt
```# Usage
```js
const quickSort = require('quick-srt');let numsArr = [46, 24, 33, 10, 2, 81, 50];
console.log(quickSort(numsArr));
// => [ 2, 10, 24, 33, 46, 50, 81 ]let lettersArr = ['d', 'h', 'z', 'a', 'r', 'b', 'i'];
console.log(quickSort(lettersArr));
// => [ 'a', 'b', 'd', 'h', 'i', 'r', 'z' ]let wordsArr = ['happy', 'auto', 'energy', 'zoo', 'trigonometry', 'dog', 'foo'];
console.log(quickSort(wordsArr));
// => [ 'auto', 'dog', 'energy', 'foo', 'happy', 'trigonometry', 'zoo' ]
```# API
## `quickSort(array)`
> Return a sorted array using quick sort algorithm
# Related
- [quick-srt-cli](https://github.com/abranhe/quick-srt-cli): CLI for this module
- [bubble-srt](https://github.com/abranhe/bubble-srt): Bubble Sort Algorithm Implementation
- [merge-srt](https://github.com/abranhe/merge-srt): Merge Sort Algorithm Implementation# Team
|[![Carlos Abraham Logo](https://avatars3.githubusercontent.com/u/21347264?s=50&v=4)](https://19cah.com)|
| :-: |
| [Carlos Abraham](https://github.com/abranhe) |# License
[MIT](https://github.com/abranhe/quick-srt/blob/master/LICENSE) License © [Carlos Abraham](https://github.com/abranhe/)