Sorting Visualizer

AI authored to showcase ironpad capabilities.

Sorting Visualizer — Interactive Algorithm Comparison

Sorting is one of the most fundamental problems in computer science. Comparison-based sorting algorithms — those that determine order purely by comparing elements — have a well-known information-theoretic lower bound:

\Omega(n \log n)

Any algorithm that sorts n elements by comparison alone must make at least \log_2(n!)\approx n\log_2 n comparisons in the worst case.

Algorithms

AlgorithmAverage TimeWorst TimeSpace
QuicksortO(n \log n)O(n^2)O(\log n)
Bubble SortO(n^2)O(n^2)O(1)
Insertion SortO(n^2)O(n^2)O(1)

Controls

Use the controls cell below to adjust the number of elements (20–200) and select which algorithm to visualize. Changing either control restarts the simulation automatically.

Color Legend

  • 🟦 Steel blue: unprocessed bars
  • 🟡 Yellow: currently being compared
  • 🔴 Red: the pivot element (Quicksort only)
  • 🟢 Green: confirmed in their final sorted position
Controls
Sorting Simulation
Statistics