PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Math Visualization

Other simulators in this category — or see all 78.

View category →
NewSchool

SIR Epidemic Model

S + I + R = 1: βSI and γI; ℛ₀ ≈ β/γ, herd threshold 1 − 1/ℛ₀; RK4 time plot.

Launch Simulator
NewSchool

SEIR / SEIRS Epidemic Model

S + E + I + R = 1: latent compartment σE delays infectiousness, recovery γI, optional waning ωR → S; ℛ₀ = β/γ; RK4 time plot.

Launch Simulator
NewUniversity / research

Three-Species Food Chain (Hastings–Powell)

Plants x → herbivores y → predators z; Holling II fᵢ(u)=aᵢu/(1+bᵢu); logistic x; chaotic attractors when b₁ is varied (1991).

Launch Simulator
NewSchool

Tumor Growth (Gompertz / Logistic)

V(t) → plateau K: Gompertz rV ln(K/V) or logistic rV(1−V/K); chemotherapy as linear kill −kV; RK4 vs untreated reference.

Launch Simulator
NewUniversity / research

Keller–Segel Chemotaxis

∂ₜn = Dₙ∇²n − χ∇·(n∇c), ∂ₜc = D_c∇²c + αn − βc; bacteria follow attractant; collapse at high χ; 96² grid.

Launch Simulator
NewUniversity / research

MinD / MinE Oscillation (E. coli Rod)

1D reaction–diffusion: membrane MinD u, fast MinE v; pole-to-pole oscillation; division plane at time-averaged MinD minimum.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Math Visualization/Sorting Algorithms (parallel)

Sorting Algorithms (parallel)

This page animates five classic comparison-based sorts on the same initial permutation of the integers 1…n: bubble sort (adjacent swaps), insertion sort (backward swaps of the next key), bottom-up merge sort (iterative passes with explicit merge steps), quicksort with Lomuto partitioning and an explicit stack, and heapsort (binary max-heap build + sift-down extracts). One global “micro-step” advances every algorithm together each frame batch: you see parallel motion patterns, not a wall-clock race (different algorithms require different total step counts). Bars are colored by index so you can track elements as they move; highlighted bars mark the current comparison or swap.

Who it's for: Intro CS courses and self-learners comparing O(n²) vs O(n log n) families visually; anyone who finished a textbook pseudocode pass and wants a side-by-side mental model.

Key terms

  • Bubble sort
  • Insertion sort
  • Merge sort
  • Quicksort
  • Heapsort
  • Lomuto partition
  • Binary heap
  • Stability (concept)

Controls

Same shuffle for all five rows; each algorithm advances in lockstep. Space — play/pause, R — reshuffle.

24
1
18

Shortcuts

  • •Space / Enter — play / pause
  • •R — reshuffle (new permutation from seed)

Measured values

Algorithms finished0 / 5

How it works

Five classic comparison sorts run on the same shuffled permutation: bubble, insertion, bottom-up merge, Lomuto quicksort, and heapsort. One synchronized micro-step per frame batch highlights how each algorithm moves elements.

Frequently asked questions

Why do the rows finish at different times?
Each algorithm needs a different number of elementary compare/swap steps for the same input. The simulator still advances them in lockstep per step, so faster-finishing rows simply idle at the sorted state while slower ones catch up.
Is merge sort here stable?
The teaching merge uses ≤ when keys tie so equal values prefer the left run—this is the usual stable tie-break. The other algorithms shown are not stable in general.
Why might quicksort look “busier” than heapsort?
Partitioning scans a whole subarray each pass and Lomuto does many swaps near the pivot; heapsort concentrates work in tree-style sift operations. Both are O(n log n) typical time, but the constant factors and memory access patterns differ.