Skip to content

BHowlader/algorithm-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Advanced Algorithm Visualizer

An interactive, feature-rich web application to visualize and learn popular Search and Sorting algorithms with real-time animations, customizable controls, and educational resources.

Algorithm Visualizer License Tailwind Status

๐ŸŒŸ Live Demo

๐Ÿš€ Try it Live


โœจ Features

๐Ÿ”Ž Search Algorithms

  • Linear Search - Sequential search through unsorted arrays (O(n))
  • Binary Search - Efficient divide-and-conquer on sorted arrays (O(log n))

๐Ÿ“Š Sorting Algorithms

  • Bubble Sort - Compare and swap adjacent elements (O(nยฒ))
  • Selection Sort - Find minimum and place at start (O(nยฒ))
  • Insertion Sort - Build sorted array incrementally (O(nยฒ))
  • Quick Sort - Fast divide-and-conquer with pivot (O(n log n))
  • Merge Sort - Stable divide-and-conquer merging (O(n log n))
  • Heap Sort - In-place heap-based sorting (O(n log n))

๐ŸŽฎ Interactive Controls

  • โฏ๏ธ Play/Pause/Reset - Full playback control
  • โšก Speed Control - Adjustable animation speed (200ms - 2000ms)
  • ๐Ÿ“ Array Size Selector - Choose from 5 to 15 elements
  • ๐ŸŽฒ Random Array Generator - Create new test data instantly
  • ๐ŸŽฏ Custom Target Input - Set search values manually

๐ŸŽจ Visual Features

  • ๐ŸŒ“ Dark/Light Theme Toggle - Beautiful themes for any preference
  • ๐ŸŽจ Color-Coded Visualization - Clear visual feedback
    • ๐ŸŸก Yellow - Currently comparing
    • ๐ŸŸข Green - Sorted/Found
    • ๐Ÿ”ด Red - Already checked
    • ๐ŸŸ  Orange - Pivot element
    • ๐Ÿ”ต Blue/Purple - Active elements
  • ๐Ÿ“Š Real-time Statistics - Live comparison and swap counters
  • ๐Ÿ“ Step-by-step Log - Detailed execution tracking

๐Ÿ’ป Learning Tools

  • ๐Ÿ“– Code Display - View actual implementation for each algorithm
  • ๐Ÿ“š Algorithm Comparison Table - Time/space complexity reference
  • โ“ Interactive Help System - Built-in tutorials and guides
  • โŒจ๏ธ Keyboard Shortcuts - Efficient navigation

๐Ÿ”Š Audio Feedback

  • ๐ŸŽต Sound Effects - Audio cues for comparisons, swaps, and completions
  • ๐Ÿ”‡ Toggle On/Off - Optional sound control

๐Ÿ“ฑ User Experience

  • ๐Ÿ“ฑ Fully Responsive - Works on mobile, tablet, and desktop
  • โŒจ๏ธ Keyboard Navigation - Complete keyboard support
  • โš™๏ธ Settings Panel - Customize your experience
  • ๐ŸŽฏ Smooth Animations - Beautiful transitions and effects

๐Ÿ› ๏ธ Technologies Used

  • React 18.x - Modern UI library with hooks
  • Tailwind CSS 3.x - Utility-first styling
  • Lucide React - Beautiful icon system
  • JavaScript ES6+ - Modern JavaScript features
  • Web Audio API - Sound effects
  • CSS3 Animations - Smooth transitions

๐Ÿ“ฆ Installation & Setup

Prerequisites

  • Node.js v14 or higher
  • npm or yarn package manager
  • Git

Quick Start

# 1. Clone the repository
git clone https://github.com/BHowlader/algorithm-visualizer.git
cd algorithm-visualizer

# 2. Install dependencies
npm install

# 3. Start development server
npm start

# 4. Open browser
# Application will open at http://localhost:3000

Build for Production

# Create optimized production build
npm run build

# The build folder contains your production-ready app

Deploy to GitHub Pages

# Install gh-pages (if not already installed)
npm install --save-dev gh-pages

# Deploy to GitHub Pages
npm run deploy

# Your site will be live at:
# https://<username>.github.io/algorithm-visualizer

๐Ÿ“ Project Structure

algorithm-visualizer/
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ index.html              # HTML template
โ”‚   โ””โ”€โ”€ favicon.ico             # Site favicon
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ””โ”€โ”€ AlgorithmVisualizer.jsx  # Main component (2500+ lines)
โ”‚   โ”œโ”€โ”€ App.js                  # Root component
โ”‚   โ”œโ”€โ”€ App.css                 # App styles
โ”‚   โ”œโ”€โ”€ index.js                # Entry point
โ”‚   โ””โ”€โ”€ index.css               # Global styles + Tailwind
โ”œโ”€โ”€ package.json                # Dependencies & scripts
โ”œโ”€โ”€ tailwind.config.js          # Tailwind configuration
โ”œโ”€โ”€ postcss.config.js           # PostCSS configuration
โ”œโ”€โ”€ .gitignore                  # Git ignore rules
โ””โ”€โ”€ README.md                   # This file

๐ŸŽฎ How to Use

Basic Usage

  1. Select Algorithm - Click any tab (Linear, Binary, Bubble, etc.)
  2. Configure - Set target value (for search) or generate random array
  3. Start - Click "Start" button or press Space
  4. Control - Use Play/Pause/Reset buttons
  5. Learn - Watch visualization and read step-by-step log

Advanced Features

  • Settings (S key) - Adjust speed and array size
  • Code View (C key) - See implementation
  • Help (H key) - View keyboard shortcuts
  • Sound - Toggle audio feedback
  • Theme - Switch between dark/light modes

Keyboard Shortcuts

Key Action
Space Play/Pause visualization
R Reset current algorithm
S Toggle Settings panel
C Toggle Code display
H Toggle Help panel

๐Ÿ“š Algorithm Complexity Reference

Algorithm Best Case Average Case Worst Case Space Stable
Linear Search O(1) O(n) O(n) O(1) N/A
Binary Search O(1) O(log n) O(log n) O(1) N/A
Bubble Sort O(n) O(nยฒ) O(nยฒ) O(1) โœ“ Yes
Selection Sort O(nยฒ) O(nยฒ) O(nยฒ) O(1) โœ— No
Insertion Sort O(n) O(nยฒ) O(nยฒ) O(1) โœ“ Yes
Quick Sort O(n log n) O(n log n) O(nยฒ) O(log n) โœ— No
Merge Sort O(n log n) O(n log n) O(n log n) O(n) โœ“ Yes
Heap Sort O(n log n) O(n log n) O(n log n) O(1) โœ— No

๐ŸŽฏ Key Learning Outcomes

After using this visualizer, you'll understand:

  • โœ… How different search algorithms work
  • โœ… Trade-offs between sorting algorithms
  • โœ… Time and space complexity concepts
  • โœ… When to use each algorithm
  • โœ… Step-by-step algorithm execution
  • โœ… Real-world performance differences

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. Push to branch
    git push origin feature/AmazingFeature
  5. Open Pull Request

Contribution Ideas

  • Add more algorithms (Radix Sort, Counting Sort, etc.)
  • Improve mobile experience
  • Add more themes
  • Translate to other languages
  • Add graph algorithms (BFS, DFS, Dijkstra)
  • Performance optimizations

๐Ÿ› Bug Reports & Feature Requests

Found a bug or have a feature idea? Please open an issue!

Bug Report Template:

**Description:** Brief description
**Steps to Reproduce:** 1. 2. 3.
**Expected:** What should happen
**Actual:** What actually happens
**Browser:** Chrome/Firefox/Safari version
**Screenshots:** If applicable

๐Ÿ“ Changelog

Version 2.0.0 (Current)

  • โœจ Added Quick Sort, Merge Sort, Heap Sort
  • โœจ Speed control slider (200ms - 2000ms)
  • โœจ Array size selector (5-15 elements)
  • โœจ Dark/Light theme toggle
  • โœจ Sound effects with toggle
  • โœจ Code display panel
  • โœจ Keyboard shortcuts system
  • โœจ Interactive help/tutorial
  • โœจ Settings panel
  • โœจ Algorithm comparison table
  • ๐Ÿ“ฑ Improved mobile responsiveness
  • ๐ŸŽจ Enhanced visual feedback
  • ๐Ÿ› Various bug fixes and optimizations

Version 1.0.0

  • Initial release with 5 algorithms
  • Basic visualization
  • Play/Pause/Reset controls

๐ŸŽ“ Educational Use

This project is perfect for:

  • ๐Ÿ“š Computer Science students
  • ๐Ÿ‘จโ€๐Ÿซ Teachers and educators
  • ๐Ÿ’ผ Interview preparation
  • ๐ŸŽฏ Algorithm learning
  • ๐Ÿซ Classroom demonstrations
  • ๐Ÿ“– Self-study and practice

Teachers: Feel free to use this in your curriculum! It's designed to make algorithm learning interactive and engaging.


๐Ÿ“„ License

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

MIT License

Copyright (c) 2025 [Bibek Howlader]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...

๐Ÿ‘จโ€๐Ÿ’ป Author

Your Name


๐Ÿ™ Acknowledgments

  • Inspired by: VisuAlgo - Algorithm Visualization
  • Built with: React, Tailwind CSS, Lucide Icons
  • Deployed on: GitHub Pages
  • Special thanks to:
    • The React team for an amazing framework
    • Tailwind Labs for beautiful styling
    • The open-source community

โญ Show Your Support

If this project helped you learn algorithms or you found it useful, please:

  • โญ Star this repository
  • ๐Ÿ› Report bugs or suggest features
  • ๐Ÿ“ข Share with others learning algorithms
  • ๐Ÿ’– Consider contributing

Give a โญ๏ธ if this project helped you!


๐Ÿ”— Related Projects


๐Ÿ“ˆ Project Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests


๐Ÿš€ Future Enhancements

Planned Features

  • More sorting algorithms (Radix, Counting, Bucket Sort)
  • Graph algorithms (BFS, DFS, Dijkstra, A*)
  • Tree algorithms (BST operations, AVL, Red-Black)
  • String algorithms (KMP, Rabin-Karp)
  • Export visualization as GIF/Video
  • Save/Load custom arrays
  • Algorithm comparison mode (side-by-side)
  • Custom color themes
  • Internationalization (i18n)
  • Performance analytics
  • Quiz mode for learning
  • Code execution timer

Community Requests

  • Submit your ideas via Issues

๐Ÿ’ฌ Feedback

Your feedback is valuable! Please:

  • ๐ŸŒŸ Star the repo if you like it
  • ๐Ÿ› Report bugs via Issues
  • ๐Ÿ’ก Suggest features
  • ๐Ÿ“ข Share with others
  • โœ๏ธ Write a review or blog post

๐Ÿ“ž Contact & Support


Made with โค๏ธ using React & Tailwind CSS

โฌ† Back to Top


Star โญ this repository if you found it helpful!

About

Interactive visualizer for search and sorting algorithms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published