CPKit
v1.6.1

Quick Sort

SortingMedium

Partition elements around a selected pivot and sort sub-arrays recursively.

Alt+Shift+Q

Configuration Panel

Pivot Partitioning Visualizer

23
0
8
1
56
2
12
3
38
4
5
5
72
6
16
7
Step: 1 / 1

Time Complexity

O(N log N) average/best, O(N^2) worst case (for skewed pivots)

Space Complexity

O(log N) recursive stack depth
Conceptual Overview

Quick Sort is a Divide-and-Conquer sorting algorithm that selects a 'pivot' element, partitions the array around it (smaller elements to left, larger to right), and recursively sorts the partitions.

Algorithm Idea

Pick a pivot (commonly the last element). Partition elements such that elements <= pivot sit on the left, and elements > pivot sit on the right. Repeat recursively.

Stable Sorting

Unstable (swaps can shift relative positions of equal elements)

In-place Memory

In-place (requires only recursive stack space)

Source: CP-Algorithms search & sorting reference