Quicksort


Abrar Rakin
Computer Science Student at University of Waterloo

Quicksort is a divide-and-conquer algorithm. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. For this reason, it is sometimes called partition-exchange sort. The sub-arrays are then sorted recursively. This can be done in-place, requiring small additional amounts of memory to perform the sorting.

The following shows the visualization in p5.js:




The code for the above visualization is given below.



To know more :

//en.wikipedia.org/wiki/quicksort

Discover more