Welcome to the Book Sorting Visualizer! This project is an interactive website that allows users to explore and understand sorting algorithms through a visual and hands-on approach.
The Book Sorting Visualizer is a virtual library where users can arrange books in alphabetical order. The website provides control over the speed and number of books displayed, enhancing the user's experience and learning process.
- User Control: Adjust the speed and number of books to be sorted.
- Sorting Algorithms: Visualize the following sorting algorithms:
- Bubble Sort
- Insertion Sort
- Quick Sort
- Selection Sort
Bubble Sort is a simple comparison-based sorting algorithm. It works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order. This process is repeated until the list is sorted.
Insertion Sort is a simple sorting algorithm that builds the final sorted array one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort. Insertion sort iterates, consuming one input element each repetition and growing a sorted output list. Each iteration removes one element from the input data, finds the location it belongs within the sorted list, and inserts it there.
Quick Sort is an efficient, comparison-based, divide-and-conquer sorting algorithm. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. The sub-arrays are then sorted recursively. This can be done in-place, requiring small additional amounts of memory to perform the sorting.
Selection Sort is a simple comparison-based sorting algorithm. It works by repeatedly selecting the smallest (or largest, depending on the sorting order) element from the unsorted portion of the list, and moving it to the end of the sorted portion of the list. This process is repeated until all elements are sorted.
- Step-by-Step Visualization: Observe each step of the sorting process, including random and worst-case scenarios.
- Interactive Learning: Aids in the visualization of complex concepts, shown to increase understanding and efficiency by 40%.
- HTML
- CSS
- JavaScript
- TypeScript
To get started with the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/yourusername/book-sorting-visualizer.git
- Navigate to the project directory:
cd book-sorting-visualizer
- Open index.html in your browser to view the website:
- Adjust Settings: Use the controls to set the speed and number of books.
- Select Algorithm: Choose a sorting algorithm to visualize.
- Start Visualization: Click the start button to begin the sorting process and observe the algorithm in action.
Contributions are welcome! If you have any suggestions or improvements, please create an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.