Skip to content

anonymousFaisal/Sorting-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Visualizer

A robust and interactive Sorting and Searching Algorithm Visualizer built using Python and Tkinter. This application allows users to visualize how various algorithms work in real-time with customizable data sets and speeds.

🚀 Features

Sorting Algorithms

  • Bubble Sort: A simple comparison-based sorting algorithm.
  • Merge Sort: A divide and conquer algorithm that sorts elements efficiently.
  • Insertion Sort: Builds the final sorted array one item at a time.
  • Selection Sort: Repeatedly selects the smallest element from the unsorted portion.
  • Quick Sort: An efficient, divide and conquer sorting algorithm.
  • Heap Sort: A comparison-based sorting technique based on a Binary Heap data structure.

Searching Algorithms

  • Linear Search: Sequentially checks each element of the list.
  • Binary Search: Efficiently finds a target value within a sorted array (automatically sorts data if needed).

Key Functionalities

  • Real-time Visualization: Watch the algorithms sort and search through data step-by-step.
  • Customizable Parameters:
    • Speed Control: Adjust the visualization speed.
    • Data Size: Set the number of elements to sort.
    • Value Range: Define the minimum and maximum values for the random data.
  • Manual Data Input: Enter your own custom data values.
  • Data Editor: Modify, add, or delete specific data points via a dedicated edit window.
  • Pause/Resume: Control the flow of the visualization.
  • Modern UI: Clean and styled interface with a gradient background.

📸 Screenshots

Main Interface

Main Interface

Sorting in Action

Sorting Demo

🛠️ Installation

  1. Prerequisites: Ensure you have Python installed on your system. You can download it from python.org.

  2. Clone the Repository:

    git clone https://github.com/yourusername/Sorting-Visualizer.git
    cd Sorting-Visualizer
  3. Install Dependencies: This project uses Pillow for image handling. Install it using pip:

    pip install Pillow

    Note: tkinter usually comes pre-installed with Python. If not, you may need to install it separately depending on your OS.

▶️ Usage

  1. Navigate to the project directory.
  2. Run the main application file:
    python main.py
  3. The application window will open.
    • Select an algorithm from the dropdown menu.
    • Adjust the Speed and Data Size sliders.
    • Click Gen to generate a new random dataset.
    • Click Start Sorting or Start Search to begin the visualization.

📂 Project Structure

Sorting-Visualizer/
├── algorithms/          # Implementation of sorting and searching algorithms
│   ├── sorting/         # Bubble, Merge, Quick, etc.
│   └── searching/       # Linear and Binary search
├── ui/                  # UI components and styling
│   ├── colors.py        # Color palette definitions
│   └── components.py    # Custom button and scale widgets
├── image/               # Images and assets (e.g., background, screenshots)
├── main.py              # Main entry point of the application
└── README.md            # Project documentation

🤝 Contributing

Contributions are welcome! If you have suggestions for improvements or new algorithms to add, feel free to open an issue or submit a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

About

A robust and interactive Sorting and Searching Algorithm Visualizer built using Python and Tkinter.

Topics

Resources

Stars

Watchers

Forks

Languages