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.
Install
npm install quick-srt
Usage
const quickSort = ; let numsArr = 46 24 33 10 2 81 50;console;// => [ 2, 10, 24, 33, 46, 50, 81 ] let lettersArr = 'd' 'h' 'z' 'a' 'r' 'b' 'i';console;// => [ 'a', 'b', 'd', 'h', 'i', 'r', 'z' ] let wordsArr = 'happy' 'auto' 'energy' 'zoo' 'trigonometry' 'dog' 'foo';console;// => [ 'auto', 'dog', 'energy', 'foo', 'happy', 'trigonometry', 'zoo' ]
API
quickSort(array)
Return a sorted array using quick sort algorithm
Related
- quick-srt-cli: CLI for this module
- bubble-srt: Bubble Sort Algorithm Implementation
- merge-srt: Merge Sort Algorithm Implementation
Team
Carlos Abraham |
License
MIT License © Carlos Abraham