๐ฅ Sorting Visualizer โ Animated Algorithm Explorer
Sorting Visualizer is an interactive visualization tool that lets you actually see how sorting algorithms work. Each element in the array is represented by a colored bar, and during execution you can watch comparisons, swaps, and merges in real time.
This project is ideal for learning, teaching, and demonstrating the working principles of classic sorting algorithms.
๐ฏ Motivation
Sorting algorithms are often taught in theory, but it can be difficult to imagine how data moves behind the scenes. The goal of this project was to create a visual learning aid where students (or interviewers!) can:
Observe how algorithms differ step by step.
Understand time complexity in action.
Experiment with different input sizes and speeds.
โจ Features
โ๏ธ Supports Bubble Sort, Selection Sort, Insertion Sort, Quick Sort, Merge Sort โ๏ธ Real-time animations with smooth transitions โ๏ธ Color-coded states (comparison, swap, sorted, inactive) โ๏ธ Adjustable speed control slider โ๏ธ Random and custom input generation โ๏ธ Live statistics panel showing:
Current speed (ms)
Swap count
Comparison count โ๏ธ Glow effect when sorting completes for extra clarity โ๏ธ Responsive design โ works on desktop & mobile
๐ ๏ธ Tech Stack
HTML5, CSS3 โ Structure & styling
JavaScript (ES6+) โ Sorting logic and animations
jQuery โ Interactive UI controls
Bootstrap / Semantic UI / Fomantic UI โ Responsive and styled components
FontAwesome โ Clean icons for actions
๐ Getting Started
Clone the repo:
git clone https://github.com//sorting-visualizer.git
Move into the project directory:
cd sorting-visualizer
Open index.html in any modern browser. โ No server setup required.
๐ฎ How to Use
Select a sorting algorithm from the top menu.
Generate a random array or enter your own custom values.
Adjust the slider to control the speed of visualization.
Press
Watch elements swap, compare, and settle into order while stats update live.
๐ Learning Outcomes
Clear understanding of sorting mechanics.
Hands-on grasp of time vs. space complexity.
Insight into why certain algorithms are better for specific cases.
Practice in JavaScript DOM manipulation and animations.
๐ง Future Improvements
๐น Add more algorithms (Heap Sort, Radix Sort, Shell Sort). ๐น Introduce a step-by-step mode for slower learning. ๐น Provide graph comparisons of algorithm performance.
Developed & customized by Abhishek Sharma (Built from scratch with inspiration from multiple algorithm resources)
๐ License
Licensed under the MIT License โ free to use and modify.
x