Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โšก DSA Solutions & Visual Explorer

License Node JavaScript Live Demo

Comprehensive JavaScript solutions for classic DSA questions combined with a premium interactive web-based visual explorer.

๐ŸŒ Live Demo: https://dsa-solutions-ten.vercel.app/


๐Ÿ“ธ Demo

Dijkstra's shortest path with live distance table updates Dijkstra's shortest path with live distance table updates

Segment Tree range query with overlap highlighting Segment Tree range query with overlap highlighting

Full keyboard shortcut support for hands-free learning Full keyboard shortcut support for hands-free learning


๐Ÿ“ธ Interactive Visual Explorer

The repository contains a custom web application located in the /visualizer directory. It uses HTML5 Canvas and an interactive step-by-step frame-animation engine to display the mechanics of algorithms in real-time.

๐ŸŽฎ Custom Animation Pipeline Controls

Our custom animation engine supports full playback controls:

  • Play/Pause (โธ / โ–ถ): Toggle active playback.
  • Step Forward (โญ): Step animation index forward by 1 frame.
  • Step Backward (โฎ): Step animation index backward by 1 frame.
  • Reset (๐Ÿ”„): Resets frame index to 0 and redraws the initial setup.
  • Speed Slider: Dynamically divides the frame timeout delay (range: 0.25x to 4x).

โŒจ๏ธ Keyboard Shortcuts

  • Enter: Run the current algorithm with selected inputs.
  • Escape:
    • If viewing an algorithm runner โž” return to the topic detail page.
    • If viewing a topic detail page โž” return to the home screen.

๐Ÿš€ Quick Start

Prerequisites

  • Node.js: version 18.0.0 or higher.
  • Browser Compatibility: Modern browsers (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+) supporting HTML5 canvas and rounded rectangles.

Running CLI Solutions

Run any solution file using Node.js directly:

# Run Graph algorithms
node 12_graphs/graphs.js

# Run Segment Tree algorithms
node 16_segment_tree/segment_tree.js

Launching the Web Visualizer

To run the interactive visualizer locally:

  1. Navigate to the visualizer directory:
    cd visualizer
  2. Spin up a local development web server:
    # Python (standard installation)
    python -m http.server 8080
    
    # Node/NPM (one-click dev server)
    npx serve .
  3. Open http://localhost:8080 in your web browser.

๐Ÿ’ก Or skip local setup entirely โ€” use the live deployment at https://dsa-solutions-ten.vercel.app/


๐Ÿ“š Master Index & Study Resources

  • Master Solutions Index: A complete list of implemented algorithms, complexities, difficulties, and file paths.
  • Algorithmic Design Patterns: Solutions categorized by standard design patterns (Two Pointers, Sliding Window, Monotonic Stack, etc.).
  • FAANG Company Mapping: Frequent interview questions from Google, Meta, Amazon, and Microsoft mapped to code solutions.
  • Complexity Cheat Sheet: Access, search, insert, and delete complexities for all data structures and sorting algorithms.
  • Technical Interview Strategy: Whiteboard strategies, dry running procedures, clarification checklists, and time allocation templates.
  • System Design Basics & DSA: Bridges data structures (Skip Lists, B-Trees, Tries) to distributed architectures (LSM Trees, Consistent Hashing, LRU Caches).

Folder Structure & Categories

  • 01_basic_math: Primality checks, factorials, digit counting, and basic number logic.
  • 02_patterns: Geometric pattern rendering, pyramids, diamonds, checkerboards, and Pascal's Triangle.
  • 03_strings: Palindrome checks, anagram validations, reversals, and character frequencies.
  • 04_arrays: Sums, min/max values, rotations by K elements, and sorted array merging.
  • 05_searching: Linear, binary, and rotated search implementations.
  • 06_sorting: Bubble, Selection, Insertion sort, and Dutch National Flag partition.
  • 07_recursion: Tower of Hanoi simulation, subsets generation, and recursive math helpers.
  • 08_data_structures: Linked Lists (insertion, deletion, middle nodes, reversals) and Array-based Stacks & Queues.
  • 09_advanced_patterns: Sliding Window bounds and Two-Pointer paradigms (e.g., 3Sum).
  • 10_advanced_misc: Matrix sorting, Catalan numbers, postfix expressions evaluation, and first missing positive.
  • 11_trees: DFS Traversals (inorder/preorder/postorder), BFS Traversals (level-order traversal), tree height, BST validation, and mirroring.
  • 12_graphs: Adjacency list implementation, BFS, DFS, shortest path in unweighted graphs, and Dijkstra's Algorithm for weighted graphs.
  • 13_dynamic_programming: Memoized Fibonacci, 0/1 Knapsack, Longest Common Subsequence (LCS), and Min Coin Change.
  • 14_heaps_trie: Min-Heap bubble-up/down logic and Trie (Prefix Tree) inserts/searches.
  • 15_bit_manipulation: Bit get/set/clear/update operations, powers of two checks, Hamming Weight (set bits count), and XOR single number.
  • 16_segment_tree: Range Sum Query and Point Update segment tree implementation.
  • 17_backtracking: N-Queens, Sudoku Solver, and Permutations.
  • 18_greedy: Activity Selection, Fractional Knapsack, and Jump Games.
  • 19_union_find: DSU class implementation, cycle detection, and Kruskal's Minimum Spanning Tree.
  • 20_monotonic_stack: Next Greater Element, Largest Rectangle in Histogram, and Trapping Rain Water using monotonic stack designs.
  • blind_75: Highly optimized solutions for standard Blind 75 questions categorized by type (Array, Binary, DP, Graph, etc.).

๐Ÿค Contributing

Contributions are welcome! Please see visualizer/README.md to understand the architecture, state transition flow, and step-by-step instructions on how to add new algorithms or visualizers.


๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.

About

๐Ÿš€ Interactive DSA Visual Explorer โ€” Run, visualize & understand 135+ algorithms with step-by-step animations. Covers Arrays, Trees, Graphs, DP, Blind 75 & more.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages