This project is a visualizer for various sorting algorithms. Users can select a sorting algorithm, generate a random array, and visualize the sorting process. It includes the following sorting algorithms:
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Choose between different sorting algorithms.
- Control the size of the array using a slider.
- Generate a new random array.
- Visualize the sorting process with color-coded comparisons and swaps.
- Display the height of each bar above it.
- Display the time taken to sort the array.
You can see a live demo of the project here.
- Clone the repository:
git clone https://github.com/your-github-harshk-89/sorting-algorithms-visualizer.git
- Navigate to the project directory:
cd sorting-algorithms-visualizer
- Open
index.html
in your web browser. - Choose a sorting algorithm from the dropdown menu.
- Adjust the size of the array using the slider.
- Click "New Array" to generate a new random array.
- Click "Sort" to start the sorting visualization.
index.html
: The main HTML file that contains the structure of the page.styles.css
: The CSS file that styles the page.script.js
: The JavaScript file that contains the logic for the sorting algorithms and the visualization.
To customize the appearance or behavior of the visualizer, you can modify the CSS and JavaScript files.
Contributions are welcome! If you have any improvements or new features to add, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.