The Heap Sort Visualization is an interactive tool designed to help users understand the Heap Sort algorithm through animated visualizations. The project allows users to input custom data or use randomly generated data and visualize the sorting process in real-time with both Top-Down and Bottom-Up approaches.
This project demonstrates the heap sort algorithm with a visual representation of array states at each step, offering valuable insights into the inner workings of the algorithm.
-
Clone the Repository
git clone https://github.com/YOUR_GITHUB_USERNAME/Heap-Sort-Visualization.git cd Heap-Sort-Visualization
-
Create a Virtual Environment
python -m venv env
-
Activate the Virtual Environment
- On Windows:
env\Scripts\activate
- On Mac/Linux:
source env/bin/activate
- On Windows:
-
Install Dependencies
pip install -r requirements.txt
-
Run the Application
streamlit run app.py
- Top-Down Heap Sort and Bottom-Up Heap Sort visualizations.
- Color-coded array elements at each step to highlight swaps and the current index.
- Interactive steps with dynamic progress through the sorting process.
- Upload a custom array or generate a random array.
- Insert or delete elements from the array dynamically.
- After the sorting process is completed, the sorted array can be downloaded as a .txt file.
- The app features a custom background image and transparent sidebar for a visually appealing interface.
- Users can control the pace of the visualization with a slider for step navigation.
- Option to view animated steps for a complete heap sort animation.
- 🐍 Python: Main programming language for the heap sort logic.
- 🌐 Streamlit: Web framework for building the interactive interface.
- 📊 Graphviz: Visualization library for displaying the heap and the sorting process.
- 🖼 PIL (Pillow): For handling image encoding and custom app styling.
- Open the web application in your browser.
- Choose random or custom input.
- Start the heap sort visualization.
- Adjust animation speed and step through sorting manually.
- Download the sorted array if needed.
🚀 Project Head: Ananya G Shetty