This Flask web app demonstrates the execution of sorting algorithms (Merge, Insertion, Selection etc.) Users can test algorithms on arrays provided directly, via files, or generated randomly, and compare performance on varying sizes. It features execution time visualizations (bar/line plots), result downloads, and aids in algorithm analysis.
This Flask web application allows users to test and compare the performance of various sorting algorithms on arrays of different sizes and types. It includes features for result visualization and downloading.
-
Input Options:
- Directly enter an array.
- Upload a file containing an array.
- Generate a random array of a specified size.
-
Execution Modes:
- Test a single array with selected sorting algorithms.
- Compare multiple algorithms on arrays of varying sizes.
-
Visualization:
- Bar chart to compare execution times for a single array.
- Line graph to show algorithm performance trends for varying input sizes.
-
Download Results: Retrieve execution results as a
.txt
file.
- Merge Sort
- Insertion Sort
- Selection Sort
- Bubble Sort
- Quick Sort
- Python 3.7 or higher
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/yourusername/sorting-visualizer.git cd sorting-visualizer
Set up a Python virtual environment to isolate dependencies:
python -m venv venv
Activate the environment:
- On Linux/Mac:
source venv/bin/activate
- On Windows (CMD):
venv\Scripts\activate
- On Windows (PowerShell):
.\venv\Scripts\Activate
Install the required Python packages using requirements.txt
:
pip install -r requirements.txt
Start the Flask application:
python app.py
Open your web browser and go to:
http://127.0.0.1:5000
Flask
Sorting Algorithms
Data Visualization
Algorithm Comparison
Python
Bar Graph
Line Graph
Random Arrays
This project is licensed under the MIT License.