Skip to content

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 and swaps in real time.

Notifications You must be signed in to change notification settings

Abhishek8208/sorting-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฅ 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 โ–ถ๏ธ Start to run the algorithm.

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.

๐Ÿ“ธ Demo Sorting Visualizer Screenshot ๐Ÿ‘จโ€๐Ÿ’ป Author

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

About

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 and swaps in real time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published