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.
- 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.
- 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).
- 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.
-
Prerequisites: Ensure you have Python installed on your system. You can download it from python.org.
-
Clone the Repository:
git clone https://github.com/yourusername/Sorting-Visualizer.git cd Sorting-Visualizer -
Install Dependencies: This project uses
Pillowfor image handling. Install it using pip:pip install Pillow
Note:
tkinterusually comes pre-installed with Python. If not, you may need to install it separately depending on your OS.
- Navigate to the project directory.
- Run the main application file:
python main.py
- 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.
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
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request

