Sắp xếp là quá trình sắp xếp các phần tử theo cách có cấu trúc. Quicksort là một trong những thuật toán sắp xếp phổ biến nhất sử dụng phép so sánh
partition [array, start, end]
{
// Setting rightmost Index as pivot
pivot = arr[end];
i = [start - 1] // Index of smaller element and indicates the
// right position of pivot found so farfor [j = start; j