Skip to content

The Sorting Visualizer is an interactive web app built with HTML, CSS, and JavaScript that visually demonstrates sorting algorithms step by step, making it easier to understand their behavior and logic.

License

Notifications You must be signed in to change notification settings

pran-ekaiva006/sorting-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฏ Sorting Visualizer

Live Demo GitHub Repo Made with JavaScript Responsive Design

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.


๐Ÿ“‘ Table of Contents


๐Ÿš€ Live Demo

Experience the interactive sorting visualizer in action:

๐Ÿ”— Sorting Visualizer Live Demo


๐Ÿ“‚ Repository

Access the complete source code:

๐Ÿ”— GitHub Repository


โœจ Features

  • ๐ŸŽจ 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

๐Ÿ› ๏ธ Tech Stack

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

๐Ÿ“‚ Folder Structure

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 documentation

๐Ÿ“ธ Preview

Sorting Visualizer Screenshot

Interactive visualization showing real-time algorithm execution with color-coded elements


โš™๏ธ Installation & Setup

Prerequisites

  • Modern web browser (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)
  • Text editor (VS Code recommended)

Quick Start

  1. Clone the repository

    git clone https://github.com/pran-ekaiva006/sorting-project.git
    cd sorting-project
  2. Launch the application

    Option 1: Direct Browser Opening

    # Simply double-click index.html or open with browser

    Option 2: Local Server (Recommended)

    # Using Python
    python -m http.server 8000
    
    # Using Node.js
    npx serve .
    
    # Using PHP
    php -S localhost:8000
  3. Access the application

    http://localhost:8000
    

๐ŸŽฎ Usage

Getting Started

  1. Open the application in your web browser
  2. Select an algorithm from the dropdown menu
  3. Adjust settings:
    • Array Size: Control the number of elements (10-100)
    • Animation Speed: Set visualization speed (1ms-200ms delay)
  4. Generate New Array to create random data
  5. Start Sort to begin the visualization

Visual Indicators

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)

Performance Metrics

  • Comparisons: Number of element comparisons made
  • Swaps: Number of element swaps performed
  • Time: Real-time execution duration

๐Ÿ“– Learning Outcomes

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

Educational Benefits

  • 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

๐Ÿค Contributing

We welcome contributions! Here's how to get involved:

How to Contribute

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add amazing feature'
  4. Push to your branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Contribution Ideas

  • ๐Ÿ”ง 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

Development Guidelines

  • Follow existing code style and conventions
  • Add comments for complex logic
  • Test thoroughly across different browsers
  • Update documentation for new features

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License - Feel free to use, modify, and distribute

๐Ÿ’ก Author

Pranjal Kumar Verma


โญ Show Your Support

If this project helped you learn something new, please give it a โญ!

Made with โค๏ธ and lots of โ˜•

โฌ† Back to Top

About

The Sorting Visualizer is an interactive web app built with HTML, CSS, and JavaScript that visually demonstrates sorting algorithms step by step, making it easier to understand their behavior and logic.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published