quick-srt

1.0.1 • Public • Published




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 ...

Install

npm install quick-srt

Usage

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

Team

Carlos Abraham Logo
Carlos Abraham

License

MIT License © Carlos Abraham

Package Sidebar

Install

npm i quick-srt

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

4.99 kB

Total Files

4

Last publish

Collaborators

  • abranhe