SortingD2Phase 2partitionin-placearray

Quick Sort

Partition-based sort known for strong average-case performance.

Easy Explanation

Quick Sort picks a pivot, groups smaller values to one side and larger values to the other, then repeats.

Renderer Mode

`Simple` uses abstract, short-form-friendly visuals. `Advanced` keeps the current detailed view.

Arrays + Grid
Visualizer
O(1)Quick Sort
Deterministic partition playback with pivot selection, comparisons, and recursive sub-range splits.

Comparisons

0

Swaps

0

Partitions

0

Depth

n/a

Ready

Press Play or Step to start execution.

No values available for visualization.
Quick Sort Implementation
Pseudocode + TypeScript
Reference implementation examples are intentionally abstracted from the playback engine so learners can map concepts to code.
pseudocode
function quickSort(values, low, high):
  if low >= high:
    return

  pivot <- values[high]
  store <- low

  for i from low to high - 1:
    if values[i] < pivot:
      swap values[i], values[store]
      store <- store + 1

  swap values[store], values[high]

  quickSort(values, low, store - 1)
  quickSort(values, store + 1, high)
1.00xNo Run