Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mbn-code/pysort
Python Sorting Visualised.
https://github.com/mbn-code/pysort
algorithm asd matplotlib python python3 sort visualization
Last synced: 3 days ago
JSON representation
Python Sorting Visualised.
- Host: GitHub
- URL: https://github.com/mbn-code/pysort
- Owner: mbn-code
- Created: 2023-07-23T21:45:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-31T00:56:16.000Z (3 months ago)
- Last Synced: 2024-11-28T17:13:44.281Z (2 months ago)
- Topics: algorithm, asd, matplotlib, python, python3, sort, visualization
- Language: Python
- Homepage: https://mbn-code.dk
- Size: 629 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PySort
Python Sorting Visualized.
## Sorting Algorithm Visualization
This repository contains a Python script that visualizes various sorting algorithms using `matplotlib` to create an animated visualization of the sorting process.
## Usage
1. Ensure you have Python and required dependencies installed:
```bash
pip install matplotlib
```2. Run `src/main.py`
3. Use the interactive interface to:
- Select sorting algorithms using buttons
- Adjust array size using the input box
- Control animation speed using the slider
- Reset data with the reset button## Supported Sorting Algorithms
Currently implemented:
- QuickSort (O(n log n) average case)
- BubbleSort (O(n²))## Visualization Features
- Interactive GUI with matplotlib
- Real-time animation of sorting process
- Color-coded visualization:
- Yellow: Elements being compared
- Red: Elements being swapped
- Light blue: Unsorted elements
- Adjustable animation speed via slider
- Customizable array size
- Reset functionality to generate new random data## Project Structure
```bash
src/
├── main.py # Main visualization interface
└── includes/ # Sorting algorithm implementations
├── quick.py # QuickSort implementation
└── bubble.py # BubbleSort implementation
```