Skip to content

Secatul/SortingVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Visualizer

A simple yet interactive visualization tool built with React and Vite to demonstrate how the Bubble Sort algorithm works in real-time.


🗂 Table of Contents


📘 Introduction

This project visualizes the Bubble Sort algorithm using animated vertical bars whose height represents array values. When sorting is initiated, the component animates comparisons and swaps with visual highlights, helping users learn sorting behavior intuitively.


💾 Installation

  1. Clone the repository:

    git clone https://github.com/lcscostadev/SortingVisualizer.git
    cd SortingVisualizer
  2. Install dependencies:

    npm install

🚀 Usage

To start the development server:

npm run dev

Then, open http://localhost:5173 in your browser to view the application.


✨ Features

  • Random bar generation
  • Bubble Sort visualization
  • Animated bar swapping with color change
  • Real-time rendering using React hooks
  • Lightweight build using Vite

📁 Project Structure

SortingVisualizer/
├── index.html
├── package.json
├── src/
│   ├── App.jsx
│   ├── main.jsx
│   ├── components/
│   │   ├── Bar.jsx
│   │   ├── Bar.css
│   │   ├── BarList.jsx
│   │   ├── BarList.css
│   │   └── index.js
├── public/
└── styles/

📦 Dependencies

Runtime:

  • react ^18.2.0
  • react-dom ^18.2.0

Development:

  • vite ^4.1.0
  • @vitejs/plugin-react
  • @types/react, @types/react-dom

⚙️ Configuration

No special configuration required. The project uses Vite for fast builds and live reload. The entry point is main.jsx, rendering the main App component into the #root element in index.html.


🧪 Examples

  • Click "Generate Random Values" to generate a new random array of bars.
  • Click "Sort" to visualize the bubble sort algorithm.
  • Bars that are being swapped during sorting are highlighted in red.

👨‍💻 Contributors

Built by lcscostadev


📄 License

This project is licensed under the MIT License.

About

This visualizer helps users understand sorting algorithms through animated bar swaps and visual cues.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors