Effective inplace string sorting algorithm.
Algorithm is NOT stable.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array
|
array which should be sorted. |
Returns:
- Type:
-
Array
Sorted array.
Example
var sort = require('path-to-algorithms/src/sorting'+
'/3-way-string-quicksort').quicksort;
console.log(sort(['bb', 'aa', 'cc'])); // [ 'aa', 'bb', 'cc' ]