Skip to content

bebopkenny/Python-Algo-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Sorting Algorithm Visualizer

Welcome to the Sorting Algorithm Visualizer, an interactive Python application built using Pygame. This project is designed to help users understand sorting algorithms through real-time visualizations. It features two fundamental sorting algorithms: Bubble Sort and Insertion Sort, both visualized step-by-step with a dynamic and colorful bar graph interface.


Demo Video

Check out the live demo of the visualizer in action!
Watch the Video on Vimeo


Project Overview

This visualizer demonstrates sorting processes with vibrant, real-time animations. Users can interact with the visualizer by selecting different sorting algorithms, adjusting sorting directions (ascending/descending), and resetting the array for a fresh start.

Features

  • Real-time visualization of sorting algorithms
  • Interactive controls for a customizable sorting experience
  • Modern UI with gradient color schemes and clear instructions
  • Educational tool for students, developers, and coding enthusiasts

Technologies Used

  • Language: Python
  • Library: Pygame
  • Fonts: Poppins and FiraCode for a clean, modern look

Screenshots

🔵 Initial State (Before Sorting)

Initial State

Switching State (During Sorting)

Switching State

Final Sorted State

Final State


Demo Video

Check out the live demo of the visualizer in action!
Watch the Video on Vimeo


Controls

Key Action
R Reset the array
SPACE Start sorting
A Sort in ascending order
D Sort in descending order
I Switch to Insertion Sort
B Switch to Bubble Sort

Color Scheme (RGB Values)

Element Color RGB Value Description
Background Dark Navy (30, 30, 30) Darker background for better contrast
Bars (Gradient) Cool Grey Shades (80, 80, 80), (130, 130, 130), (180, 180, 180) Gradient from dark to light grey
Text Light Blue (0, 191, 255) For instructions and algorithm name
Comparison Red (255, 69, 58) Bars being compared during sorting
Sorted Green (0, 255, 127) Bars that are fully sorted

Code Structure


Learning Outcomes

This project helps users understand:

  • How sorting algorithms work step-by-step
  • The difference between Bubble Sort and Insertion Sort
  • The importance of visual representation in understanding algorithms
  • How to use Pygame for creating interactive visualizations

How to Run the Project Locally

  1. Clone the Repository:
    git clone https://github.com/your-username/sorting-visualizer.git
    cd sorting-visualizer
  2. Install Dependencies: Make sure you have Python and Pygame installed:
    pip install pygame
  3. Run the Application:
    python main.py

Future Improvements

  • Adding more sorting algorithms (Quick Sort, Merge Sort, etc.)
  • Enhancing the UI with additional controls and themes
  • Optimizing the visualizer for better performance

Contact

For any inquiries or feedback, please reach out:


📄 License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Sorting Algorithm Visualizer that brings sorting algorithms to life using Pygame. Watch Bubble Sort and Insertion Sort in action with real-time, step-by-step visualizations through a dynamic and colorful bar graph interface, making algorithm learning interactive and fun!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages