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 61.

View category →
NewSchool

SIR Epidemic Model

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

Launch Simulator
NewSchool

Sandpile (SOC)

BTW abelian model: add grains, ≥4 topples to neighbors; critical avalanches.

Launch Simulator
NewUniversity / research

Flow Field Particles

Synthetic v(x,y,t); advection with wrap; optional arrow grid.

Launch Simulator
NewSchool

Fractal Generator

Mandelbrot, Julia, Koch snowflake. Zoom infinitely.

Launch Simulator
NewKids

Conway's Game of Life

B3/S23 on a torus: paint cells, run, step — glider, LWSS, Gosper gun, pulsar, and more.

Launch Simulator
NewSchool

a → v → x

Integrate acceleration to velocity and position; stacked time graphs.

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.