The below image shows the working of a quick sort.
Below example shows the working program for quick sort in python:
def quickSort(alist):
   quickSortHelper(alist,0,len(alist)-1)
def quickSortHelper(alist,first,last):
   if first<last:
       splitpoint = partition(alist,first,last)
...