Electrical & Computer
Sorting Visualizer Lab
Sorting is the first place every CS student meets algorithmic complexity, and this lab makes the difference visible. Shuffle an array of bars and pick an algorithm: it compares and swaps them step by step until they line up shortest to tallest, with the compared bars lit and the finished region turning green. Bubble, insertion and selection sort are the classic O(n²) algorithms — clear to follow but visibly sluggish, and their comparison counter climbs quadratically as you add bars. Quick sort is O(n log n) divide-and-conquer: run the same array through it and watch how many fewer comparisons it needs to reach the same result. The live step and comparison counters turn the abstract Big-O notation into something you can actually watch happen.
Each bar is a number; the algorithm compares and swaps them until they line up shortest to tallest. Bubble, insertion and selection are the O(n²) sorts — fine for a few bars, painfully slow as the array grows. Quick sort is O(n log n): watch how many fewer comparisons it needs. That gap is exactly what Big-O measures.
How to use this simulation
Sorting is the first place every CS student meets algorithmic complexity, and this lab makes the difference visible. Shuffle an array of bars and pick an algorithm: it compares and swaps them step by step until they line up shortest to tallest, with the compared bars lit and the finished region turning green. Bubble, insertion and selection sort are the classic O(n²) algorithms — clear to follow but visibly sluggish, and their comparison counter climbs quadratically as you add bars. Quick sort is O(n log n) divide-and-conquer: run the same array through it and watch how many fewer comparisons it needs to reach the same result. The live step and comparison counters turn the abstract Big-O notation into something you can actually watch happen.
Everything runs in your browser — no sign-up, no download. Change a value and the result updates instantly, so you can build a feel for how each input shapes the outcome. It pairs with Crameleon's practice exams and step sheets when you want to go from intuition to working the problems.