Beautiful real-time visualization of the Bubble Sort algorithm
- π Dynamic Gradient Colors
- π Real-time Statistics (Comparisons & Swaps)
- π¬ Smooth Animations
- π― Color-coded Comparisons
- β Completion Indicator
- π¨ Modern Dark Theme UI
- C++ Compiler (GCC 7+, Clang 5+, or MSVC 2017+)
- SFML 2.5+
sudo apt-get update
sudo apt-get install libsfml-devbrew install sfmlDownload SFML from official website
git clone https://github.com/haladayyeh/bubble-sort-visualizer.git
cd bubble-sort-visualizerg++ bubble_sort_visualizer.cpp -o visualizer -lsfml-graphics -lsfml-window -lsfml-system -std=c++11./visualizerModify the data array:
vector<int> data = {180, 90, 150, 50, 120, 40, 200, 70, 160, 100, 140, 80};Adjust animation speed:
sleep(milliseconds(50)); // Change 50 to your preferred speed- Time Complexity: O(nΒ²)
- Space Complexity: O(1)
- Best Case: O(n)
- Worst Case: O(nΒ²)
Contributions are welcome! Feel free to fork and submit pull requests.
MIT License - feel free to use this project for learning and educational purposes.
Give a βοΈ if this project helped you!
hala dayyeh
- GitHub: @haladayyeh
Made with β€οΈ and C++