Skip to content

pragya79/tkinter-sort-visualizer

Repository files navigation

Sorting Visualizer

This project visualizes various sorting algorithms using Python and Tkinter. It provides an interactive way to observe how different sorting algorithms work by visualizing the array's transformations through colored bars.

Table of Contents

  1. Overview
  2. Supported Sorting Algorithms
  3. Installation
  4. Usage

Overview

The Sorting Visualizer helps you visualize how various sorting algorithms work. You can watch each step of the sorting process in real-time with visual indicators:

  • Red bars represent the elements that are currently being compared.
  • White bars represent the elements that are not yet sorted.
  • Green bars represent that all elements are sorted now.

The visualizer includes multiple sorting algorithms, allowing you to compare and analyze their performance.

Supported Sorting Algorithms

The Sorting Visualizer currently supports the following sorting algorithms:

  1. Bubble Sort
  2. Selection Sort
  3. Insertion Sort
  4. Merge Sort
  5. Quick Sort

Each algorithm is visualized step-by-step, showing how the array is manipulated during the sorting process.

Installation

Tkinter Installation

Before you can run the visualizer, you need to have Tkinter installed, as it is used to create the GUI for visualizing the sorting algorithms.

For Windows:

  1. Tkinter comes pre-installed with Python. If you don’t have it, download Python from the official Python website and make sure to select the option to install Tkinter during installation.

  2. To check if Tkinter is installed, open a terminal/command prompt and run:

    python -m tkinter
  3. Clone the repositiory:

    git clone https://github.com/pragya79/tkinter-sort-visualizer.git
    

Usage

  1. Open a terminal or command prompt.
  2. Navigate to the directory where the project is located.
  3. Run the following command to start the Sorting Visualizer:
    python visualizer.py
  4. The GUI will open, and you will be able to select a sorting algorithm from the dropdown list.
  5. Click the "Sort" button to visualize the sorting process.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages