Implementing Quicksort in #javascript
▻https://hackernoon.com/implementing-quicksort-in-javascript-45cb83ab1aa0?source=rss----3a8144ea
Quicksort is one of the most efficient methods for sorting an array in computer science. For a thorough breakdown, it has its own Wikipedia article.This article will cover implementing quicksort in JavaScript. Quicksort is not built in to JavaScript. Due to the sort method on the Array prototype, sorting is rarely questioned or optimized in the language. Despite that, Quicksort is still an important algorithm to at least comprehend, whether or not you use it.How does it work? ?Quicksort works by picking an element from the array and denoting it as the “pivot.” All other elements in the array are split into two categories — they are either less than or greater than this pivot element.Each of the two resulting arrays (array of values less-than-the-pivot and array of values (...)