Skip to content

Interactive visualization tool for algorithms and data structures, Compare different algorithms in different languages to better understand the underlying logic/flow.

License

NotificationsYou must be signed in to change notification settings

m8nt0/algorithm-visualizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Universal DSA Visualizer Playground

A modular, framework-agnostic architecture for visualizing and learning about Data Structures and Algorithms.

Features

  • 🧩 Modular Architecture: Clean separation between core logic and UI
  • πŸ“Š Interactive Visualizations: Step-by-step visualization of algorithms and data structures
  • πŸ”„ Multi-language Support: View and run code samples in TypeScript, Python, C++, and more
  • πŸ“š Learning Content: Detailed explanations and complexity analysis
  • πŸ”Œ Framework-Agnostic: Core logic can be used with any UI framework

Project Structure

πŸ“¦ dsa-visualizer/
β”œβ”€β”€ core/                         # Framework-agnostic business logic
β”‚   β”œβ”€β”€ algorithms/               # Algorithm metadata, logic, code samples
β”‚   β”œβ”€β”€ data_structures/          # DS definitions, metadata, visual models
β”‚   β”œβ”€β”€ visualizer/               # Step-by-step state engine for visualization
β”‚   β”œβ”€β”€ interpreter/              # Cross-language execution layer
β”‚   └── shared/                   # Utilities, types, helpers
β”‚
β”œβ”€β”€ ui/                           # UI implementations
β”‚   β”œβ”€β”€ sveltekit/                # Initial implementation using SvelteKit
β”‚   β”œβ”€β”€ react/                    # Future support
β”‚   └── vanilla/                  # Optional no-framework support
β”‚
β”œβ”€β”€ public/                       # Static assets
β”œβ”€β”€ docs/                         # Markdown docs for algorithms and DS
└── tests/                        # Unit tests

Getting Started

Prerequisites

  • Node.js (v16+)
  • npm or yarn

Installation

# Clone the repository
git clone https://.com/yourusername/dsa-visualizer.git
cd dsa-visualizer

# Install dependencies
npm install

# Start the development server
npm run dev

Usage

  1. Visit http://localhost:5173 in your browser
  2. Browse available algorithms and data structures
  3. Select an algorithm to visualize
  4. Use the controls to step through the visualization
  5. View and modify the code samples
  6. Learn about the algorithm's complexity and use cases

Extending

Adding a New Algorithm

  1. Add your algorithm definition to core/algorithms/index.ts
  2. Provide code samples in multiple languages
  3. Link it to related data structures
  4. Add visualization steps in the playground component

Adding a New Data Structure

  1. Add your data structure definition to core/data_structures/index.ts
  2. Implement the visualizer function to render the structure
  3. Define key operations and their complexity
  4. Add code samples for each operation

Future Plans

  • Add more algorithms and data structures
  • Implement WASM-based execution for non-JavaScript languages
  • Add React and vanilla JS UI implementations
  • Support for user-defined algorithms and data structures
  • Mobile-responsive design

License

This project is licensed under the MIT License - see the LICENSE file for details.