Skip to content

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Sorting-Algorithms-Project

Interactive Python sorting algorithm visualizer with real-time bar animations and 8-bit sound feedback. Supports multiple algorithms, adjustable speed and array size, and displays comparisons, swaps, and execution time using a Tkinter GUI. Features ๐Ÿ“Š Real-time sorting visualization ๐Ÿ”Š Optional 8-bit sound feedback โšก Adjustable sorting speed ๐ŸŽš Adjustable array size ๐Ÿ”€ Shuffle array instantly ๐Ÿ“ˆ Live statistics: Comparisons Swaps Execution time ๐ŸŽจ Modern Tkinter GUI ๐Ÿ”” Automatic sound fallback if audio library is unavailable ๐Ÿง  Algorithms Included

The visualizer currently supports:

Bubble Sort Selection Sort Insertion Sort Merge Sort Quick Sort Heap Sort Comb Sort

Each algorithm runs step-by-step so the visualization can animate each comparison and swap.

๐Ÿ”Š Sound System

The application includes a custom SoundEngine that generates tones based on the values being compared.

Each comparison produces a short tone. Tone pitch changes depending on the element values. When sorting finishes, a short ascending melody plays.

If the simpleaudio library is installed, real audio will be played. Otherwise, the program falls back to the system Tkinter bell sound.

๐Ÿ“ฆ Installation

  1. Clone the repository git clone https://github.com/yourusername/sorting-visualizer-sound.git cd sorting-visualizer-sound
  2. Install optional dependency for sound pip install simpleaudio
  3. Run the program python sorting_visualizer.py ๐ŸŽฎ How to Use Choose a sorting algorithm from the dropdown menu. Adjust the array size and sorting speed. Click Shuffle to generate a random array. Click Sort to start the visualization. Enable or disable 8-bit sound using the toggle.

Watch the bars move and listen to the sorting process in real time.

๐Ÿ›  Built With Python Tkinter โ€“ GUI framework simpleaudio โ€“ sound playback threading & queues โ€“ asynchronous sound handling ๐ŸŽ“ Educational Purpose

This project helps students and developers:

Understand how sorting algorithms operate internally Compare different algorithms visually Experience algorithm behavior through visual + audio feedback ๐Ÿš€ Possible Future Improvements More algorithms (Shell Sort, Radix Sort) Pause / step mode Dark/light themes Algorithm complexity display Export visualization as GIF or video

โญ If you find this project useful, consider starring the repository!

About

Interactive Python sorting algorithm visualizer with real-time bar animations and 8-bit sound feedback. Supports multiple algorithms, adjustable speed and array size, and displays comparisons, swaps, and execution time using a Tkinter GUI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages