</>
ShikshaCSLearn. Code. Grow.
🔍
☕ Support Us
ShikshaCSâ€ēMini Projects
{ }

Sorting Algorithm Visualizer

DSAIntermediate
JavaScriptCanvas/DOM

💡 Overview

Watching bars swap and settle into order makes sorting algorithms 'click' in a way that reading pseudocode never quite does. It's also a genuinely impressive portfolio piece.

✅ Features to Build

0/4 done

🧭 Step-by-Step Guide

1

Render the array as a row of <div> bars, with each bar's height set from its value.

2

Implement Bubble Sort normally in JS, but instead of just swapping instantly, record each swap as a 'step'.

3

Use setTimeout or requestAnimationFrame to play back the recorded steps one at a time, updating bar heights/colors.

4

Highlight the two bars currently being compared in a different color during each step.

5

Add a dropdown to switch between Bubble Sort and a second algorithm, reusing the same visualization logic.

💡 Pro Tip

Separate your CODE from your ANIMATION — first get the sorting logic recording a clean list of steps, THEN write a separate function that just plays back those steps visually. Mixing both at once gets messy fast.

← Back to all Projects