Skip to content

colingalbraith/Algorithms

Repository files navigation

Algorithm And Data Structure Visualizations

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)

Contents

  1. DFS&BFS.py

    • Visualizes Depth-First Search and Breadth-First Search on a graph or grid. See how nodes are explored step by step.
  2. sort.py

    • Demonstrates several sorting algorithms (Bubble Sort, Insertion Sort, Merge Sort, etc.) in real time.
  3. Stack&Que.py

    • An interactive Stack and Queue demo. Push/pop or enqueue/dequeue elements and watch the operations happen live.
  4. Stable_Marriage_Visualization.py

    • Animates the Stable Marriage Problem using the Gale–Shapley algorithm.
  5. Kruskal-prim.py

    • Animates Common Minimal spanning tree algorithms.

Getting Started

  1. 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

image

sort.py

image

Stable_Marriage_Visualization.py

image

DFS&BFS.py

image

kruskal-prim.py

image

Contributing

  1. Fork this repository.

  2. Create a new branch for your feature or bugfix.

  3. Commit your changes.

  4. Open a Pull Request describing the changes you’ve made.

About

A collection of simple Python visualizations for classic algorithms and data structures.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages