Skip to content

An interactive Sorting Algorithm Visualizer built with Python (Flask) and JavaScript. It features real-time animations, audio sonification, and a live code-walkthrough modal. Users can input custom arrays or generate random ones to explore the mechanics and Big O complexity of Bubble, Merge, and Quick Sort in a sleek dark-mode interface.

Notifications You must be signed in to change notification settings

jayant-kumar-gupta/Sorting-Algorithm-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Sorting Algorithm Visualizer

AlgoVision is an interactive, web-based educational tool designed to visualize classic sorting algorithms in real-time. Built with a Python (Flask) backend and a vanilla JavaScript frontend, this application helps users understand the mechanics of sorting through dynamic animations, audio sonification, and step-by-step code execution.


πŸš€ Key Features

1. Interactive Visualization

  • Dynamic Canvas: Vertical bars represent integer values.
  • Color-Coded States:
    • 🟑 Yellow: Comparison
    • πŸ”΄ Red: Swap action
    • 🟒 Green: Sorted/Locked state
    • 🟣 Purple: Pivot element (QuickSort)

2. Supported Algorithms

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort

3. Advanced Controls

  • Custom Inputs: Users can input specific comma-separated arrays (e.g., 10, 45, 2, 99) via the "Apply Array" feature.
  • Dynamic Generation: A modal prompts users to define the specific size of a random array (N=5 to N=100).
  • Speed Control: Adjustable slider to control animation delay (10ms - 1000ms).

4. Educational Metrics

  • Audio Sonification: Distinct sound frequencies play during swaps, creating an auditory representation of the sorting process.
  • Real-Time Stats: Live counters for Total Comparisons and Total Swaps.
  • Code Inspection: A "Show Code" modal displays the actual Python implementation of the selected algorithm.
  • Complexity Analysis: dynamically updates Big-O notation for Time and Space complexity.

πŸ›  Tech Stack

  • Backend: Python 3, Flask (RESTful API architecture)
  • Frontend: HTML5, CSS3 (Modern Dark Mode), JavaScript (ES6+)
  • State Management: Asynchronous fetch requests with JSON-based step parsing.

πŸ“‚ Project Structure

β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── style.css       # Main stylesheet (Dark Theme)
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   └── script.js       # Animation logic & API handling
β”‚   └── sounds/             # (Optional) Static audio assets
β”œβ”€β”€ templates/
β”‚   └── index.html          # Main application interface
β”œβ”€β”€ app.py                  # Flask server & Sorting logic
β”œβ”€β”€ requirements.txt        # Python dependencies
└── README.md               # Project documentation

βš™οΈ Installation & Setup Follow these steps to run the project locally.

Prerequisites Python 3.x installed

pip (Python package manager)

  1. Clone the Repository Bash git clone https://github.com/your-username/algovision-visualizer.git cd algovision-visualizer
  2. Create a Virtual Environment (Recommended) Bash

Windows

python -m venv venv venv\Scripts\activate

Mac/Linux

python3 -m venv venv source venv/bin/activate 3. Install Dependencies Bash pip install flask 4. Run the Application Bash python app.py 5. Access the App Open your browser and navigate to: http://127.0.0.1:5000/

About

An interactive Sorting Algorithm Visualizer built with Python (Flask) and JavaScript. It features real-time animations, audio sonification, and a live code-walkthrough modal. Users can input custom arrays or generate random ones to explore the mechanics and Big O complexity of Bubble, Merge, and Quick Sort in a sleek dark-mode interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published