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.
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
Line Highlighting - See which line executes
Variable Tracking - Watch values change
Syntax Highlighting - Clean, readable code
Python Implementation - Production-quality code
Time Complexity - Big-O breakdown
Space Complexity - Memory analysis
Mathematical Intuition - Why it works
Key Insights - Core algorithm ideas
Dark Theme - Easy on the eyes
Responsive - Works on all devices
No Dependencies - Pure HTML/CSS/JS
Fast Loading - Instant visualization
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
Product Except Self
Prefix/Suffix
O(n)
O(n)
Product of all elements except self
Trapping Rain Water
Two Pointer
O(n)
O(1)
Calculate water trapped between bars
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
Group Anagrams
HashMap/Frequency
O(n·k)
O(n·k)
Group words that are anagrams
BPE Tokenizer
Byte Pair Encoding
O(m·n)
O(V)
Iteratively merge frequent byte pairs into tokens
Integer to Words
Recursion
O(1)
O(1)
Convert integer to English word representation
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
Word Search
DFS/Backtracking
O(m·n·4^L)
O(L)
Find if word exists in 2D grid
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
Algorithm
Technique
Time
Space
Description
Power of Two
Bitwise AND
O(1)
O(1)
Check if number is power of 2
Python 3.13+ (for algorithm implementations)
Any modern web browser (for visualizations)
# 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
# Using Python's built-in server
cd visualizations
python -m http.server 8000
# Visit http://localhost:8000
Contributions are welcome! Here's how to add a new algorithm:
Add Python Implementation in algos/category/algorithm_name.py
Create Visualization in visualizations/category/algorithm-name/
Add to Index - Update visualizations/index.html
Add Tests in tests/category/test_algorithm_name.py
This project is licensed under the MIT License - see the LICENSE file for details.