Skip to content

gungorefecetin/sorting-visualizer-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Algorithm Visualizer

A beautiful, interactive web application that visualizes various sorting algorithms in real-time. This project helps in understanding how different sorting algorithms work through visual representation.

🌟 Features

  • Multiple Sorting Algorithms:

    • Quick Sort
    • Merge Sort
    • Heap Sort
    • Bubble Sort
  • Interactive Controls:

    • Adjustable array size (10-100 elements)
    • Variable sorting speed
    • Generate new random arrays
    • Real-time visualization
  • Performance Metrics:

    • Time elapsed
    • Number of comparisons
    • Array access count

💻 Technologies Used

  • JavaScript (ES6+)
  • HTML5
  • CSS3
  • No external dependencies!

⛳️ Demo Images

Screenshot 2026-02-23 at 09 38 13 Screenshot 2026-02-23 at 09 39 00

🎯 Algorithm Implementations

Quick Sort

  • Uses the divide-and-conquer strategy
  • Average time complexity: O(n log n)
  • Partition-based sorting

Merge Sort

  • Divide-and-conquer algorithm
  • Stable sorting algorithm
  • Time complexity: O(n log n)

Heap Sort

  • Binary heap data structure
  • In-place sorting algorithm
  • Time complexity: O(n log n)

Bubble Sort

  • Simple comparison-based algorithm
  • Time complexity: O(n²)
  • Great for educational purposes

🛠️ Getting Started

  1. Clone the repository:

    git clone https://github.com/yourusername/sorting-visualizer.git
  2. Navigate to the project directory:

    cd sorting-visualizer
  3. Open the project:

    • Simply open index.html in your web browser
    • No build process or dependencies required!

📖 How to Use

  1. Generate New Array:

    • Click the "Generate New Array" button to create a new random array
    • Use the array size slider to adjust the number of elements
  2. Choose Algorithm:

    • Select your desired sorting algorithm from the dropdown menu
  3. Adjust Speed:

    • Use the speed slider to control the visualization speed
    • Move right for faster animation, left for slower
  4. Start Sorting:

    • Click "Start Sorting" to begin the visualization
    • Watch the bars rearrange in real-time!

🎨 Visual Guide

  • Blue bars: Unsorted elements
  • Yellow bars: Elements being compared/swapped
  • Green bars: Sorted elements

🤝 Contributing

Contributions are welcome! Here are some ways you can contribute:

  1. Add new sorting algorithms
  2. Improve visualization effects
  3. Add additional performance metrics
  4. Fix bugs or improve performance

Please feel free to submit issues and pull requests.

👏 Acknowledgments

  • Inspired by various sorting algorithm visualizers
  • Built with modern JavaScript features
  • Designed with a focus on educational value

⭐️ If you found this project helpful, please give it a star!

About

Browser-based sorting algorithm visualizer — watch Quick Sort, Merge Sort, Heap Sort, and Bubble Sort animate in real time with adjustable speed, array size, and live performance metrics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors