Skip to content

Visualize and understand how various sorting algorithms work!

Notifications You must be signed in to change notification settings

ZohairZaidi/SortingAlgorithmsVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

Sorting Algorithms Visualizer

Introduction

Sorting Algorithm Visualizer is a powerful tool that allows users to witness the step-by-step execution of various sorting algorithms through an intuitive graphical interface. Whether you are a student studying algorithms or a developer looking to optimize your code, this visualizer provides valuable insights into the inner workings and efficiency of sorting algorithms.

Key Features

  • Step-by-Step Visualization: With Sorting Algorithm Visualizer, you can observe each individual step of the sorting process in real-time. This allows you to understand how different sorting algorithms rearrange elements to achieve the final sorted order.

  • Array Access Count: Ever wondered how many times an algorithm accesses elements during sorting? Our visualizer keeps track of the number of element accesses, giving you a quantitative measure of algorithmic efficiency and providing valuable information for comparative analysis.

  • Color-Coded Visualization: To enhance the understanding of the sorting process, elements are color-coded to represent their state at any given time. This makes it easy to visualize how elements are moved and compared, making the algorithm's behavior crystal clear.

Supported Sorting Algorithms

The Sorting Algorithm Visualizer currently supports the following sorting algorithms:

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort

Demo

QuickSort.mov
HeapSort.mov
SelectionSort.mov
InsertionSort.mov
BubbleSort.mov

How to Use

  1. Clone the repository to your local machine.
  2. Open the project in your preferred IDE or code editor.
  3. Run the application and select the sorting algorithm you want to visualize.
  4. Observe the graphical representation of the sorting algorithm in action, step-by-step.
  5. Analyze the array access count and the color-coded element movement to gain insights into the efficiency of the chosen algorithm.

Requirements

To run this program, you need to install python and the following libraries:

  • Mathplotlib
  • Numpy
  • Scipy

Additionally, to view each change in the sorting algorithm, create a folder named "frames" in your working directory. This is where images of the sorting process will be stored.

About

Visualize and understand how various sorting algorithms work!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages