A web-based application that demonstrates six different sorting algorithms through real-time animations, built with HTML, CSS, and JavaScript. Users can adjust the speed and size of the array, offering an interactive way to understand sorting algorithms visually.
- Visual Sorting Algorithms: Supports Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, and Heap Sort.
- Adjustable Speed and Size: Controls for sorting speed and array size (up to 150 elements).
- Color-Coded Indicators:
- Yellow: Element being compared or Pivot element (for Quick Sort)
- Red: Elements being swapped
- Green: Elements in the correct sorted position
- Blue: Elements yet to be sorted
- HTML: Structure of the application.
- CSS: Styling for an intuitive user interface.
- JavaScript: Logic for sorting algorithms, animations, and user interactions.
The following algorithms are available for visualization:
- Bubble Sort: Compares and swaps adjacent elements if needed.
- Selection Sort: Finds the smallest unsorted element and swaps it with the leftmost unsorted element.
- Insertion Sort: Builds the sorted array one element at a time.
- Merge Sort: Recursively divides, sorts, and merges array halves.
- Quick Sort: Partitions array around a pivot and sorts each part recursively.
- Heap Sort: Builds a heap and repeatedly extracts the largest element to sort.
- Clone the Repository:
git clone https://github.com/swapnilgavali295/sorting-visualizer.git cd sorting-visualizer