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.
- 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.
- Clone the repository:
git clone https://github.com/Amaan9136/DSA-Visualizer.git cd DSA-Visualizer - Open
index.htmlin 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
- Navigate to the local URL (e.g.,
http://localhost:3000orhttp://localhost:8000) and start exploring.
- 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.
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 |
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) |
- HTML, CSS, Tailwind CSS, JavaScript
- No external frameworks required (vanilla JS)
Contributions are welcome! If you’d like to add new algorithms, improve visuals, or fix bugs:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Commit your changes and push:
git commit -m "Add: your feature" git push origin feature/your-feature - Open a pull request.
This project is open source and available under the MIT License.
Built as an educational tool to make learning algorithms more visual, intuitive, and engaging.