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

Related simulators

Continue with similar topics in this category — or all 85 in Math Visualization.

View category →
FeaturedSchool

Trigonometry Circle

Launch Simulator

Unit circle with live sin, cos, tan values as you drag.

NewUniversity / research

Runge–Kutta Stability Regions

Launch Simulator

Absolute-stability regions in the z = hλ plane for explicit Euler, RK2, and RK4; move λ and h, compare |R(z)|, and see why stiff modes constrain explicit time steps.

NewSchool

Convex Hull (Graham & QuickHull)

Launch Simulator

Click to add points, drag to move; Graham scan with step playback or QuickHull divide-by-farthest; compare vertex sets.

NewUniversity / research

Gradient Descent Optimizers

Launch Simulator

Compare SGD, momentum, and Adam on a curved loss landscape; tune learning rate, curvature, stability, and iteration count.

NewKids

Monte Carlo π

Launch Simulator

Uniform samples in a square; 4·(in disk)/N estimates π.

NewSchool

Lotka–Volterra

Launch Simulator

N′ = αN−βNP, P′ = δNP−γP; phase plane RK4; equilibrium dot.

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)

Bubble, insertion, merge, quicksort, and heapsort on the same shuffled permutation — five bar rows advance in lockstep so you can compare how each method moves values.

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

About this model

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)

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.