Skip to content

joshiayush/wizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wizard

Interactive Algorithm Visualizations for Learning DSA

Live Demo Python License


Typing SVG

View Live Demo | Report Bug | Request Feature


Wizard - Algorithm Visualization

What is Wizard?

Wizard is an interactive algorithm visualization platform designed to help you understand data structures and algorithms through hands-on exploration. Watch algorithms execute step-by-step, see code highlight in sync, and build deep intuition for how they work.


Features

Interactive Visualization

  • Play/Pause - Auto-advance or step manually
  • Speed Control - Adjust animation speed
  • Reset - Start over with new inputs
  • Random - Generate test cases automatically

Code Synchronization

  • Line Highlighting - See which line executes
  • Variable Tracking - Watch values change
  • Syntax Highlighting - Clean, readable code
  • Python Implementation - Production-quality code

Complexity Analysis

  • Time Complexity - Big-O breakdown
  • Space Complexity - Memory analysis
  • Mathematical Intuition - Why it works
  • Key Insights - Core algorithm ideas

Modern Design

  • Dark Theme - Easy on the eyes
  • Responsive - Works on all devices
  • No Dependencies - Pure HTML/CSS/JS
  • Fast Loading - Instant visualization

Algorithm Catalog

Arrays

Algorithm Technique Time Space Description
Two Sum HashMap O(n) O(n) Find two numbers that sum to target
Sort Colors Dutch National Flag O(n) O(1) Sort array of 0s, 1s, and 2s in-place
Maximum Subarray Kadane's Algorithm O(n) O(1) Find contiguous subarray with largest sum
Best Time to Buy/Sell Single Pass O(n) O(1) Maximize profit from stock transactions
Hybrid Quick Sort 3-Way Partition O(n log n) O(log n) QuickSort with duplicate handling
Kth Largest Element Max Heap O(n + k log n) O(n) Find kth largest without full sort

Strings

Algorithm Technique Time Space Description
KMP Pattern Matching Failure Function O(n + m) O(m) Efficient substring search
Longest Palindrome Expand Around Center O(n²) O(1) Find longest palindromic substring

Matrix

Algorithm Technique Time Space Description
Number of Islands DFS/BFS O(m×n) O(m×n) Count connected land components
Flood Fill BFS O(m×n) O(m×n) Paint connected region with new color
Shortest Path BFS 8-Direction O(m×n) O(m×n) Find shortest path in binary matrix

Linked Lists

Algorithm Technique Time Space Description
Sort Linked List Merge Sort O(n log n) O(log n) Sort linked list using merge sort
Merge K Lists Divide & Conquer O(n log k) O(log k) Merge k sorted linked lists

Bit Manipulation

Algorithm Technique Time Space Description
Power of Two Bitwise AND O(1) O(1) Check if number is power of 2

Quick Start

Prerequisites

  • Python 3.13+ (for algorithm implementations)
  • Any modern web browser (for visualizations)

Installation

# Clone the repository
git clone https://github.com/joshiayush/wizard.git
cd wizard

# Install Python dependencies (optional, for running tests)
pip install poetry
poetry install

Running Locally

# Using Python's built-in server
cd visualizations
python -m http.server 8000
# Visit http://localhost:8000

Running Tests

poetry run pytest

Tech Stack

Frontend Backend Tools
HTML5 Python Poetry
CSS3 pytest
JavaScript GitHub Actions

Contributing

Contributions are welcome! Here's how to add a new algorithm:

  1. Add Python Implementation in algos/category/algorithm_name.py
  2. Create Visualization in visualizations/category/algorithm-name/
  3. Add to Index - Update visualizations/index.html
  4. Add Tests in tests/category/test_algorithm_name.py

License

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


Built with curiosity by Ayush Joshi


Start Learning