This repository contains several Python-based visualizations for popular algorithms and data structures, including:
- Depth-First Search (DFS) and Breadth-First Search (BFS)
- Sorting algorithms (e.g., Bubble Sort, Insertion Sort, Merge Sort, Quick Sort)
- Stack and Queue operations
- Stable Marriage Problem (Gale–Shapley Algorithm)
- Kruskal and Prim (Minimum Spanning Trees)
-
DFS&BFS.py
- Visualizes Depth-First Search and Breadth-First Search on a graph or grid. See how nodes are explored step by step.
-
sort.py
- Demonstrates several sorting algorithms (Bubble Sort, Insertion Sort, Merge Sort, etc.) in real time.
-
Stack&Que.py
- An interactive Stack and Queue demo. Push/pop or enqueue/dequeue elements and watch the operations happen live.
-
Stable_Marriage_Visualization.py
- Animates the Stable Marriage Problem using the Gale–Shapley algorithm.
-
Kruskal-prim.py
- Animates Common Minimal spanning tree algorithms.
- Clone the repository
git clone https://github.com/YOUR_USERNAME/Algorithm-Visualizations.git
Replace YOUR_USERNAME with your GitHub username or the actual repo location.
Install dependencies Ensure you have Python 3 installed. Required libraries may include tkinter, matplotlib, or others. If this repo has a requirements.txt, install them with: pip install -r requirements.txt
If not, you can manually install any necessary libraries.
Run the scripts Pick an algorithm you want to visualize: python DFS&BFS.py
or python sort.py
Interact with the GUI Each script opens an interactive window. Use the provided buttons (e.g., Start, Stop, Randomize, Push, Pop) to control how the algorithm runs.
Examples:
Stack&Que.py
sort.py
Stable_Marriage_Visualization.py
DFS&BFS.py
kruskal-prim.py
-
Fork this repository.
-
Create a new branch for your feature or bugfix.
-
Commit your changes.
-
Open a Pull Request describing the changes you’ve made.