Select an algorithm to see it come to life through CSS
Bubble Sort
Compare adjacent elements and swap if in wrong order
O(n²)
Algorithm Steps:
Compare first two elements
If first > second, swap them
Move to next pair and repeat
Largest element "bubbles" to the end
Repeat for remaining elements
Bubble Sort — pure HTML + CSS visualization
Fixed example array: [5, 3, 8, 1, 6]. This single-file demo uses only HTML and CSS. The animation changes each element's order in steps to show how bubble sort swaps values until sorted.