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.
|
|
|
|
| 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 |
| 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 |
| 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 |
| 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:8000poetry run pytestContributions 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.