Sorting Stick is a visual representation of popular sorting algorithms built using SFML (Simple and Fast Multimedia Library) in C++. This educational game helps users understand how different sorting algorithms operate by animating their processes.
- C++
- SFML (Simple and Fast Multimedia Library)
- Bubble Sort โ Repeatedly swaps adjacent sticks if they are in the wrong order, bubbling the largest to the end.
- Insertion Sort โ Builds the sorted array one stick at a time by inserting elements into their correct position.
- Selection Sort โ Finds the smallest stick in each pass and places it at the correct position from the start.
- Merge Sort โ Divides the array into halves, recursively sorts them, and merges the sorted halves.
- Quick Sort โ Partitions the array around a pivot and recursively sorts the sub-arrays.
- Radix Sort โ Sorts sticks by processing digits from least to most significant using counting sort as a subroutine.
- The sticks are stored in a dynamic array
- Each Stick is a custom struct that contains properties such as height and color, used for visualization.
- Real-time visual feedback for sorting operations
- Highlights each step during the sort
- Educational tool for beginners to understand sorting algorithms visually
- SFML installed on your system
-
Clone the repository:
git clone https://github.com/Chintan-Patel-Games/Sorting-Stick.git
-
Run the executable
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort
- Quick Sort
- Radix Sort