JavaScript is required for this website. Please allow JavaScript and refresh the page.
home Home
sort Sorts
LOGARITHMIC
Quick Sort Merge Sort Heap Sort
QUADRATIC
Bubble Sort Selection Sort Insertion Sort Gnome Sort Shaker Sort Odd Even Sort Pancake Sort
WEIRD
Bitonic Sort Radix Sort Shell Sort Comb Sort Bogo Sort
CUSTOM
Your Sort
SORT VISUALIZER
Quick Sort
Elements: 100
DESCRIPTION

Quick Sort is a sorting algorithm based on splitting the data structure in smaller partitions and sort them recursively until the data structure is sorted.

This division in partitions is done based on an element, called pivot: all the elements bigger than the pivot get placed on the right side of the structure, the smaller ones to the left, creating two partitions. Next, this procedure gets applied recursively to the two partitions and so on.

This partition technique based on the pivot is called Divide and conquer. It's a performant strategy also used by other sorting algorithms, such as Merge Sort.

COMPLEXITY
Average Complexity O(n × log n)
Best Case O(n × log n)
Worst Case O(n2)
Space Complexity O(n)