Update quickSort.md

This commit is contained in:
Angelos Chalaris
2017-12-28 13:42:57 +02:00
committed by GitHub
parent dfbe3cae3e
commit 0b0fe7fa65

View File

@ -2,7 +2,9 @@
QuickSort an Array (ascending sort by default).
Use recursion. Use `Array.filter` and spread operator (`...`) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. If the parameter `desc` is truthy, return array sorts in descending order.
Use recursion.
Use `Array.filter` and spread operator (`...`) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it.
If the parameter `desc` is truthy, return array sorts in descending order.
```js
const quickSort = ([n, ...nums], desc) =>