Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithm Visualizer

Interactive visualizations of algorithms and data structures to help students and developers learn core CS concepts through step-by-step animations and hands-on experimentation.

Features

  • Sorting Visualizations – Watch algorithms like Bubble Sort operate step by step on arrays.
  • Graph Visualizations – Explore graph structures, perform searches, and generate random graphs.
  • Custom Input – Enter your own data to see how algorithms behave on specific cases.
  • Interactive Controls – Play, pause, and adjust speed to follow each operation closely.
  • Randomized Examples – Generate new random arrays and graphs for endless practice.

Getting Started

  1. Clone the repository:
    git clone https://github.com/Amaan9136/DSA-Visualizer.git
    cd DSA-Visualizer
  2. Open index.html in your browser:
    # Option 1: Directly
    # Open index.html in Chrome, Firefox, etc.
    
    # Option 2: Using a local server (recommended)
    npx serve .
    # or
    python -m http.server
  3. Navigate to the local URL (e.g., http://localhost:3000 or http://localhost:8000) and start exploring.

Usage

  • Sorting: Generate a random array or enter custom values, then press Play to visualize the sorting process. Adjust speed to slow down or speed up the animation.
  • Graphs: Create a new random graph, set a start node, and run search algorithms to see traversal in action.

Implemented Algorithms

The visualizer currently covers 35 algorithms across 9 categories, each with step-by-step animation, pseudocode, an explanation, complexity analysis, and a matching Python reference implementation.

Category Algorithms
Sorting Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, Heap Sort
Searching Linear Search, Binary Search, Jump Search, Exponential Search
Arrays Two-Pointer Technique, Sliding Window (Max Sum Subarray), Kadane's Algorithm, Prefix Sums
Linked Lists Insert, Delete, Reverse, Cycle Detection (Floyd's Tortoise and Hare)
Stack Balanced Parentheses, Next Greater Element (Monotonic Stack)
Queue FIFO Enqueue/Dequeue, Circular Queue
Hash Tables Insert / Search / Delete with Collision Handling via Chaining
Trees BST Build, BST Search, BST Delete, Inorder/Preorder/Postorder/Level-order Traversal, AVL Insert (with rotations)
Graphs BFS, DFS, Dijkstra's Shortest Path, Kruskal's MST

Pending / Roadmap

The following are planned but not yet implemented:

Category Planned algorithms
Dynamic Programming Knapsack, Longest Common Subsequence (LCS), Longest Increasing Subsequence (LIS), Coin Change, Edit Distance
Greedy Activity Selection, Fractional Knapsack, Huffman Coding
Recursion Factorial, Fibonacci, Tower of Hanoi
Backtracking N-Queens, Sudoku Solver, Rat in a Maze, Word Search
Divide & Conquer Closest Pair of Points, Matrix Exponentiation
Strings KMP, Rabin-Karp, Z-Algorithm, Trie-based Search
Advanced Structures Tries, Segment Trees, Fenwick Trees (BIT), Red-Black Trees, Union-Find (standalone)
Advanced Graphs Bellman-Ford, Floyd-Warshall, A* Search, Prim's MST, Kosaraju's / Tarjan's (SCC)

Technologies

  • HTML, CSS, Tailwind CSS, JavaScript
  • No external frameworks required (vanilla JS)

Contributing

Contributions are welcome! If you’d like to add new algorithms, improve visuals, or fix bugs:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/your-feature
  3. Commit your changes and push:
    git commit -m "Add: your feature"
    git push origin feature/your-feature
  4. Open a pull request.

License

This project is open source and available under the MIT License.

Acknowledgments

Built as an educational tool to make learning algorithms more visual, intuitive, and engaging.

About

Interactive visualizations of data structures and algorithms to help students and developers learn core CS concepts through step-by-step animations and hands-on experimentation.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages