Skip to content

kinza7124/Algorithm-Visualiser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

🎨 Sorting Visualizer πŸ“Š

A Sorting Algorithm Visualizer built using HTML, CSS, and JavaScript.
This project demonstrates how various sorting algorithms work by visualizing the sorting process in real-time with animated bars.
It includes dark mode, customizable bar colors, speed control, and swap count tracking.


🌟 Features

  • 🎨 Beautiful UI with Light/Dark Mode toggle.
  • πŸ”„ Sorting Algorithms Supported:
    • 🟒 Bubble Sort
    • 🟑 Selection Sort
    • πŸ”΅ Insertion Sort
    • 🟣 Merge Sort
    • πŸ”΄ Quick Sort
  • 🎚️ Adjustable animation speed.
  • 🎨 Customizable bar colors.
  • πŸ”’ Swap counter to track operations.
  • πŸ”€ Generate a new random array instantly.
  • πŸ“± Fully responsive design.

πŸ“Έ Screenshots

🌞 Light Mode

image

🌚 Dark Mode

image

πŸ› οΈ Tech Stack

  • HTML5 β†’ Structure
  • CSS3 β†’ Styling & Dark Mode
  • JavaScript (ES6) β†’ Sorting algorithms, animations, and interactivity

πŸ“¦ Installation & Usage

1️⃣ Clone the repository

git clone https://github.com/<your-username>/sorting-visualizer.git

2️⃣ Navigate to the project folder

cd sorting-visualizer

3️⃣ Run the project

Just open the index.html file in any modern browser.

πŸ“š How It Works

Sorting Algorithms Visualized

Algorithm Time Complexity Space Complexity Stability Visualization
Bubble Sort O(nΒ²) O(1) βœ… Stable βœ…
Selection Sort O(nΒ²) O(1) ❌ Unstable βœ…
Insertion Sort O(nΒ²) O(1) βœ… Stable βœ…
Merge Sort O(n log n) O(n) βœ… Stable βœ…
Quick Sort O(n log n) O(log n) ❌ Unstable βœ…
  • Each bar represents an array element.

  • Bar height corresponds to the value.

  • Swaps are animated to visualize the sorting process.

⚑ Controls

Control Description

  • 🎨 Bar Color Picker Change the color of bars dynamically
  • ⏱ Speed Slider Adjust animation speed
  • πŸ”„ Generate Array Create a new random dataset
  • πŸ”€ Sorting Buttons Choose between 5 sorting algorithms
  • πŸŒ™ Dark Mode Toggle between light & dark themes
  • πŸ”’ Swap Counter Shows the number of swaps performed

πŸ“‚ Project Structure

sorting-visualizer/

β”œβ”€β”€ index.html # Main HTML file

β”œβ”€β”€ README.md # Project documentation (Since CSS & JS are embedded in the HTML file.)

🧠 Future Enhancements

βœ… Add Heap Sort & Counting Sort

βœ… Add Sound effects for swaps 🎡

βœ… Deploy live demo on GitHub Pages

βœ… Improve mobile responsiveness

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to fork the repository and submit a pull request.

πŸ“œ License

This project is licensed under the MIT License β€” you are free to use, modify, and distribute it.

πŸ‘©β€πŸ’» Author

Kinza Afzal πŸ“§ kinzaafzal07122004@gmail.com

🌐 GitHub Profile: kinza7124

⭐ Support

If you like this project, don’t forget to star the repository ⭐ on GitHub!

Releases

No releases published

Packages

No packages published

Languages