Quick Sort firstly introduced by Tony Hoare in 1960 is a divide and conquer algorithm . It is a mostly wide-used algorithm among others.
The main process of quick sort is as following:
Quick_Sort(A,i,j) //sort array A from i to j
if i<j
p = Partition(A,i,j); //
Quick_Sort(A,i,p-1)
Quick_Sort(A,p+1,j)
As procedure of QS above, the most important and difficult part is the Partition procedure which divide the array into two parts. And, all elements of each part is less or greater than an element, which is carefully choosen by Partition, indexed by the variant named p.