An Interactive Web Platform for Visualizing Algorithms and Data Structures
Live Demo β’ Report Bug β’ Request Feature
- β Bubble Sort (Implemented)
- β Merge Sort (Implemented)
- β Quick Sort (Implemented)
- β Selection Sort (Implemented)
- β Insertion Sort (Implemented)
- β Heap Sort (Implemented)
- β Counting Sort (Implemented)
- β Radix Sort (Implemented)
AlgoVisualizer is a modern, interactive web application designed to help students, developers, and algorithm enthusiasts understand complex Data Structures and Algorithms (DSA) through visual, step-by-step execution. Whether you're preparing for technical interviews, studying for exams, or simply curious about how algorithms work under the hood, AlgoVisualizer makes learning engaging and intuitive.
- π― Visual Learning: See algorithms in action with real-time, animated visualizations
- π Interactive Controls: Adjust speed, pause, and step through algorithms at your own pace
- π¨ Modern UI: Clean, responsive interface built with React and Tailwind CSS
- π Comprehensive Coverage: From basic sorting to advanced pathfinding algorithms
- π§ Educational Focus: Perfect for students, teachers, and self-learners
- π» No Installation: Run directly in your browser
- Interactive Controls:
- Step-by-step algorithm visualization
- Interactive forward/backward navigation
- Real-time complexity metrics (comparisons, swaps, merges)
- Educational explanations for each step
- Keyboard navigation support (arrow keys)
- Visual representation of algorithm steps
Technology | Description |
---|---|
Frontend framework for building UI | |
Fast build tool and dev server | |
Utility-first CSS framework | |
Programming language | |
Deployment platform |
AlgoVisualizer/
βββ public/ # Static assets
β βββ algo.svg # Vite logo
βββ src/ # Source files
β βββ components/ # React components
β βββ pages/
| | βββ Arrays # Array Data Structure
| | βββ BinarySearch # Binary Search Questions
| | βββ Graph # Graph Data Structure
| | βββ BitManipulation # Bit Manipulation Questions
| | βββ DynamicProgramming # Dynamic Programming Questions
| | βββ Deque # Deque Data Structure
| | βββ GreedyAlgorithms # Greedy Algorithms Question
| | βββ Hashing # Hashing Data Structure
| | βββ LinkedList # Linked List Data Structure
| | βββ Pathfinding # Pathfinding Algorithms Question
| | βββ Queue # Queue Data Structure
| | βββ Recursion # Recursion Question
| | βββ Stack # Stack Data Structure
| | βββ Strings # Strings Data Structure
| | βββ Tree # Tree Data Structure
| | βββ Trie # Trie Data Structure
| | βββ Sorting # Sorting Algorithms Question
| | βββ SlidingWindows #Sliding Window Algorithm Question
| | βββ Heaps # Heaps
β βββ search/ # Search
β β βββ catalog.js/ # Catalog of algorithms
β βββ App.jsx # Main App component
β βββ App.css # Global styles
β βββ main.jsx # Entry point
β βββ index.css # Base CSS
βββ .gitignore # Git ignore rules
βββ index.html # HTML template
βββ package.json # Dependencies and scripts
βββ vite.config.js # Vite configuration
βββ README.md # Project documentation
Before you begin, ensure you have the following installed:
- Node.js (v14.0 or higher)
- npm (v6.0 or higher) or yarn
-
Clone the repository
git clone https://github.com/mahaveergurjar/AlgoVisualizer.git cd AlgoVisualizer
-
Install dependencies
npm install # or yarn install
-
Start the development server
npm run dev # or yarn dev
-
Open your browser
Navigate to http://localhost:5173 to view the application.
npm run build
# or
yarn build
The optimized production build will be generated in the dist/
folder.
- Select a sorting algorithm from the dropdown menu
- Adjust the array size and speed using the sliders
- Click "Generate New Array" to create random data
- Press "Start" to begin the visualization
- Use "Pause/Resume" to control the execution
- Click "Reset" to return to the initial state
- Choose between Dijkstra's or A* algorithm
- Click on the grid to set walls/obstacles
- Set start and end points
- Adjust visualization speed
- Click "Visualize" to see the algorithm in action
- Select DFS or BFS
- Click nodes to create a graph structure
- Choose a starting node
- Watch the traversal process unfold
We welcome contributions from developers of all skill levels! Whether it's fixing bugs, adding features, improving documentation, or suggesting ideas, your help is appreciated.
-
Fork the repository
git clone https://github.com/YOUR-USERNAME/AlgoVisualizer.git
-
Create a feature branch
git checkout -b feature/AmazingFeature
-
Make your changes
- Write clean, readable code
- Follow the existing code style
- Add comments where necessary
- Test your changes thoroughly
-
Commit your changes
git commit -m 'Add some AmazingFeature'
-
Push to your branch
git push origin feature/AmazingFeature
-
Open a Pull Request
- Provide a clear description of your changes
- Reference any related issues
- Wait for review and feedback
- β Ensure your code follows the project's coding standards
- β Write meaningful commit messages
- β Test your changes before submitting
- β Update documentation if needed
- β Be respectful and constructive in discussions
- β Follow the standard visualization layout (see below)
- β Don't submit spam or low-quality PRs
All algorithm visualizations must follow this consistent layout for a uniform user experience:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HEADER SECTION β
β - Problem Title (e.g., "Trapping Rain Water") β
β - Problem Description/LeetCode Number β
β - Back to Problems Button β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INPUT CONTROLS ROW β
β - Input Field (for array/data input) β
β - Navigation Controls (Previous/Next Step) β
β - Step Counter (e.g., "31/39") β
β - Reset Button β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ALGORITHM TABS (if multiple approaches) β
β - Brute Force O(nΒ²) β
β - Optimal O(n) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β LEFT PANEL β RIGHT PANEL β
β β β
β CODE SECTION β VISUALIZATION SECTION β
β - Syntax highlighted β - Main visual representation β
β - Line numbers β - Interactive bars/nodes/graph β
β - Current line highlightβ - Color-coded elements β
β - Step-by-step execute β - Animated transitions β
β β - Current position indicator β
ββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA STRUCTURE DISPLAY (if applicable) β
β - Arrays/Stacks/Queues being used β
β - Show values at each step β
β - Highlight active elements β
β Example: β
β Left Max Array (lmax): [0, 1, 1, 2, 2, 2, ...] β
β Right Max Array (rmax): [3, 3, 3, 3, 3, 2, ...] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OUTPUT SECTION β
β - Final result display β
β - Clear visual indicator β
β Example: "Total Trapped Water: 6" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EXPLANATION SECTION β
β - Step-by-step explanation of current operation β
β - Formula/logic being applied β
β Example: "Water at index 4 = min(max[4], rmax[4]) β
β - height[4] = min(2, 3) - 1 = 1" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β COMPLEXITY ANALYSIS β
β - Time Complexity: O(n) with explanation β
β - Space Complexity: O(n) with explanation β
β - Brief description of approach β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
When creating a new visualization, ensure you include:
-
Header Section
- Clear problem title
- Subtitle with problem number or description
- Navigation back to problem list
-
Input Controls
- Input field for custom data entry
- Play/Pause button for animation
- Step forward/backward buttons (β βΊ)
- Speed control slider
- Reset button to start over
- Step counter showing progress
-
Code Display (Left Panel)
- Syntax-highlighted code
- Line numbers
- Current executing line highlighted
- Support for multiple language tabs (C++, Java, Python)
-
Visualization Area (Right Panel)
- Main visual representation (bars, nodes, grid, etc.)
- Smooth animations between states
- Color coding:
Blue
- Currently processingGreen
- Completed/correctRed
- Comparison/errorYellow/Gold
- Special focusGray
- Default/unprocessed
- Clear labels and indices
-
Data Structure Display
- Show auxiliary arrays/stacks/queues if used
- Display current values
- Highlight active elements
- Update in sync with main visualization
-
Output Section
- Large, clear display of final result
- Use success color (green) for completion
- Include units or context
-
Explanation Panel
- Dynamic text explaining current step
- Show formulas or calculations
- Update with each step
- Keep it concise and clear
-
Complexity Analysis
- Time complexity with Big-O notation
- Space complexity with Big-O notation
- Brief explanation of why
- Comparison with other approaches if applicable
Before submitting your visualization, ensure:
- Follows the standard layout structure
- Includes all required sections
- Code is properly syntax highlighted
- Animations are smooth and not too fast/slow
- Colors are consistent with the design system
- Responsive design works on different screen sizes
- Input validation handles edge cases
- Step-by-step navigation works correctly
- Explanation text is clear and educational
- Complexity analysis is accurate
- Code is well-commented
- No console errors or warnings
This project participates in Hacktoberfest! We encourage quality contributions during October and throughout the year.
The visualization follows our standard layout with:
- Input controls at the top
- Code visualization on the left
- Interactive elevation map on the right
- Data structure displays (lmax, rmax arrays)
- Real-time output and step explanations
- Complexity analysis at the bottom
Add more screenshots of your visualizations here
Want to learn more about the algorithms visualized in this project?
- No known critical issues at this time
- Report bugs via GitHub Issues
Distributed under the MIT License. See LICENSE
file for more information.
Mahaveer Gurjar
- GitHub: @mahaveergurjar
- Project Link: https://github.com/mahaveergurjar/AlgoVisualizer
- Inspired by the need for better algorithm education tools
- Thanks to all contributors who have helped improve this project
- Built with β€οΈ for the developer community
If you're contributing for the first time (like during Hacktoberfest π), follow these simple steps to set up AlgoVisualizer locally:
# 1οΈβ£ Fork this repository (click 'Fork' on GitHub)
# 2οΈβ£ Clone your fork
git clone https://github.com/<your-username>/AlgoVisualizer.git
# 3οΈβ£ Navigate into the project folder
cd AlgoVisualizer
# 4οΈβ£ Install required dependencies
npm install
# 5οΈβ£ Start the local development server
npm run dev
Now open your browser and go to π http://localhost:5173
to explore the app locally!
If you find this project helpful, please consider giving it a β!
Made with π» and β by developers, for developers.