An interactive web application that brings sorting algorithms to life through stunning visualizations
The Sorting Visualizer is built with HTML, CSS, and JavaScript to demonstrate how different sorting algorithms work step by step. Users can adjust array size and animation speed to better understand algorithm behavior, featuring clear visual representations of comparisons and swaps that make learning sorting algorithms engaging and intuitive.
- ๐ Live Demo
- ๐ Repository
- โจ Features
- ๐ ๏ธ Tech Stack
- ๐ Folder Structure
- ๐ธ Preview
- โ๏ธ Installation & Setup
- ๐ฎ Usage
- ๐ Learning Outcomes
- ๐ค Contributing
- ๐ License
- ๐ก Author
Experience the interactive sorting visualizer in action:
๐ Sorting Visualizer Live Demo
Access the complete source code:
๐ GitHub Repository
- ๐จ Interactive Visualization - Watch algorithms come to life with smooth animations
- โก Customizable Parameters - Adjust array size (10-100 elements) and animation speed
- ๐ Multiple Algorithms supported:
- Bubble Sort - Simple comparison-based algorithm
- Selection Sort - Find minimum and swap approach
- Insertion Sort - Build sorted array one element at a time
- Merge Sort - Efficient divide-and-conquer algorithm
- Quick Sort - Fast partition-based sorting
- ๐ฑ Responsive Design - Works seamlessly on desktop, tablet, and mobile
- ๐ Performance Metrics - Real-time comparison and swap counters
- ๐จ Color-Coded Elements - Visual indicators for different algorithm states
- ๐ Reset Functionality - Generate new random arrays instantly
| Technology | Purpose |
|---|---|
| HTML5 | Structure and semantic markup |
| CSS3 | Modern styling with Flexbox/Grid |
| JavaScript (ES6+) | Algorithm logic and DOM manipulation |
| CSS Animations | Smooth visual transitions |
| Vercel | Deployment and hosting |
| Git | Version control |
sorting-project/
โโโ ๐ index.html # Main entry point with HTML structure
โโโ ๐จ style.css # Comprehensive styling and animations
โโโ โ๏ธ script.js # Core logic & sorting algorithm implementations
โโโ ๐ assets/ # Static resources
โ โโโ ๐ผ๏ธ preview.png # Application screenshot
โโโ ๐ README.md # Project documentationInteractive visualization showing real-time algorithm execution with color-coded elements
- Modern web browser (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)
- Text editor (VS Code recommended)
-
Clone the repository
git clone https://github.com/pran-ekaiva006/sorting-project.git cd sorting-project -
Launch the application
Option 1: Direct Browser Opening
# Simply double-click index.html or open with browserOption 2: Local Server (Recommended)
# Using Python python -m http.server 8000 # Using Node.js npx serve . # Using PHP php -S localhost:8000
-
Access the application
http://localhost:8000
- Open the application in your web browser
- Select an algorithm from the dropdown menu
- Adjust settings:
- Array Size: Control the number of elements (10-100)
- Animation Speed: Set visualization speed (1ms-200ms delay)
- Generate New Array to create random data
- Start Sort to begin the visualization
| Color | Meaning |
|---|---|
| ๐ต Blue | Unsorted elements |
| ๐ด Red | Elements being compared |
| ๐ข Green | Elements in final sorted position |
| ๐ก Yellow | Pivot element (Quick Sort) or current key (Insertion Sort) |
- Comparisons: Number of element comparisons made
- Swaps: Number of element swaps performed
- Time: Real-time execution duration
After exploring this visualizer, you'll gain:
- ๐ Algorithm Understanding: Step-by-step comprehension of how sorting algorithms work
- โฑ๏ธ Time Complexity Insights: Visual understanding of algorithm efficiency differences
- ๐ฏ Performance Analysis: Ability to compare algorithm performance metrics
- ๐ป Technical Skills: Knowledge of DOM manipulation and CSS animations
- ๐ง Problem-Solving: Enhanced algorithmic thinking and optimization concepts
- Visual Learning: See abstract concepts in action
- Interactive Exploration: Hands-on experience with different parameters
- Comparative Analysis: Direct comparison between algorithm behaviors
- Real-time Feedback: Immediate visualization of algorithm decisions
We welcome contributions! Here's how to get involved:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add amazing feature' - Push to your branch
git push origin feature/amazing-feature
- Open a Pull Request
- ๐ง New Algorithms: Heap Sort, Radix Sort, Counting Sort
- ๐จ UI Improvements: Enhanced animations, dark/light theme toggle
- ๐ Features: Algorithm complexity information, sound effects
- ๐ฑ Mobile: Touch gesture controls, mobile-optimized interface
- ๐งช Testing: Unit tests, performance benchmarks
- Follow existing code style and conventions
- Add comments for complex logic
- Test thoroughly across different browsers
- Update documentation for new features
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License - Feel free to use, modify, and distribute
Pranjal Kumar Verma
- ๐ง Email: [email protected]
- ๐ GitHub: @pran-ekaiva006
- ๐ Portfolio: View my work
If this project helped you learn something new, please give it a โญ!
Made with โค๏ธ and lots of โ
