Computer Science Beginner ⏱ 15 min

Sorting Algorithms Visualizer: Bubble, Merge & QuickSort

Compare comparison counts, array swaps, and asymptotic time complexity across Bubble Sort, Insertion Sort, Merge Sort, and QuickSort.

Live Functional Response Graph

Real-time parametric response curve updated as you adjust the controls.

Scientific Explanation & Mathematical Model

O(n²) Quadratic (Bubble/Insert) vs. O(n log₂ n) (Merge/Quick)

Variables & Units: Comparison sorting requires Ω(n log₂ n) comparisons in the average and worst case.

Assumptions & Limitations: RAM uniform-cost comparison model.

Worked Numerical Example: At n = 32: Bubble Sort requires 496 comparisons vs ~160 for Merge Sort.

Guided Inquiry & Challenge Mode

🎯 Challenge Goal:

Set Array Size n above its midpoint while keeping Algorithm (1=Bub,2=Ins,3=Mrg,4=Qck) below its midpoint to unlock the target state.

In Progress...

Knowledge Check

How does changing Array Size n govern the output in O(n²) Quadratic (Bubble/Insert) vs. O(n log₂ n) (Merge/Quick)?