← Back to DSA Visualizer

Quick Sort Visualization

Quick Sort is a divide-and-conquer algorithm that picks a pivot element and partitions the array around it. Elements smaller than pivot go to the left, larger elements go to the right.

Time Complexity

Best: O(n log n)

Average: O(n log n)

Worst: O(n²)

Space Complexity

O(log n)

Comparisons

0

Swaps

0

Max Depth

0

800ms
0
Progress: 0 / 00%
Unsorted
Pivot
Left Pointer
Right Pointer
Comparing
Swapping
Sorted

How Quick Sort Works

Algorithm Steps:

  1. 1. Choose a pivot element (usually last element)
  2. 2. Partition array around pivot
  3. 3. Elements ≤ pivot go left, others go right
  4. 4. Recursively sort left and right subarrays
  5. 5. Combine sorted subarrays

Key Properties:

  • • Divide and conquer approach
  • • In-place sorting algorithm
  • • Not stable (relative order may change)
  • • Average case is very efficient
  • • Worst case when pivot is always min/max