0% found this document useful (0 votes)
5 views

23BCS11965 - Rohit Gupta Python

Uploaded by

amisha080204
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

23BCS11965 - Rohit Gupta Python

Uploaded by

amisha080204
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

MINI PROJECT :

PYTHON PROGRAMMING

Topic : Sorting Visualizer

Faculty: Er. Mohit Singh Bisht


Presented By : Rohit Kumar Gupta
Uid : 23BCS11965
Section : 708/A
Sorting Visualizer
A sorting algorithm is an algorithm that puts the elements of a list in a certain order. While there are a large number
of sorting algorithms, in practical implementations a few algorithms predominate. ​

In this implementation of sorting visualizer, we'll be looking at some of these sorting algorithms and visually
comprehend their working. The sorting algorithms covered here are Selection Sort, Insertion Sort, Bubble Sort,
Merge Sort, Quick Sort and Heap Sort. The list size is fixed to 130 elements.
Sorting Visualizer Overview

Interactive Experience Visual Representation

The sorting visualizer allows users to The tool uses dynamic visuals to
interactively explore and compare represent the sorting process, making
different sorting algorithms in real-time. it easier to understand the underlying
algorithms.

Educational Approach Customization Options


The visualizer serves as an Users can adjust various parameters,
educational resource, helping users such as data size and sorting speed,
learn about sorting algorithms and to personalize their exploration the
their performance characteristics. sorting algorithms.
Tool Used

• Programming language- Python


• Visualization of different sorting algorithms in python with pygame module.
• Code editor- VS Code
• Available Controls inside Sorting Visualizer:-
• Use SPACE for Start Sorting.
• Use R for Reset.
• Use S to start Selection Sort Algorithm.
• Use I to start Insertion Sort Algorithm.
• Use B to start Bubble Sort Algorithm.
• Use M to start Merge Sort Algorithm.
• Use Q to start Quick Sort Algorithm.
• Use A for ascending and D for descending.
User Interaction And Controls

• Algorithm Selection : Users can choose from a range of sorting algorithms to visualize and
compare their performance.

• Data Size Adjustment : The visualizer allows users to adjust the size of the input data, enabling
them to observe the scalability of the algorithms.

• Speed Control : Users can control the speed of the sorting animation, allowing them to slow down
or speed up the process for better understanding.

• Pause and Step-by-Step : The visualizer provides the ability to pause the animation and step
through the sorting process, enabling a more detailed analysis.
Output: Sorting Visualizer
Output: Sorting Visualizer
Future Development of Project

• There are several ways we could enhance the Sorting Algorithm Visualizer and make it more advanced and feature-rich:

• 1. Add more sorting algorithms: Future versions could include advanced algorithms like Heap Sort, Shell Sort, and
Radix Sort.
• 2. Algorithm performance comparison: Adding a feature that displays the time complexity and space complexity of
each sorting algorithm for more efficient.
• 3. User-defined lists: Instead of only visualizing randomly generated lists, we could allow users to input their own lists
of numbers or even strings, making the tool more flexible and useful for specific cases.
• 4. Different data structures: We could expand it to work with other data structures like linked lists, trees, or graphs,
showcasing how sorting works in different scenarios.
• 5. Mobile or web-based version: We could develop a web-based or mobile version of the visualizer.
Conclusion

The provided code is a sorting algorithm visualizer program built using the Python Pygame
library. It allows users to choose between different sorting algorithms such as Bubble Sort,
Insertion Sort, QuickSort, MergeSort, and Selection Sort.

The program generates a visual representation of the sorting process in real-time, giving users a
clear understanding of how the algorithms work by highlighting comparisons and swaps. The
output is displayed in the GUI window, and users can control the sorting speed and order
(ascending or descending) for further interaction.

This code serves as an excellent starting point for learning about basic sorting techniques and
GUI development using Python.

You might also like