This project is an algorithm visualizer application made with Python and Pygame that shows the sorting processes for the bubble sort, selection sort, shell sort, and insertion sort algorithms
- Bubble sort
- Insertion sort
- Selection sort
- Shell sort
Sorting Algorithm | Average Time Complexity | Worst Case Time Complexity |
---|---|---|
Bubble Sort | O(N^2) | O(N^2) |
Insertion Sort | O(N^2) | O(N^2) |
Selection Sort | O(N^2) | O(n^2) |
Shell Sort | O(N^5/4) | O(N^2) |
- Clone GitHub repository:
git clone https://github.com/ackenney/algorithm-visualizer.git
- Install requirements:
pip install -r requirements.txt
- Run:
python main.py
- Press the R key to create a new random array to test
- Press the spacebar key to start the sorting with the currently selected algorithm
- Press 1 to select the insertion sort algorithm
- Press 2 to select the bubble sort algorithm
- Press 3 to select the selection sort algorithm
- Press 4 to select the shell sort algorithm