2 The algorithm

The quicksort algorithm has two main stages. The first stage, called partitioning, divides an array into two parts with respect to a “pivot”. Then, each part after pivoting is sorted by the algorithm recursively.

 2.1 Partitioning
 2.2 Sorting algorithm