This project demonstrates a graphical visualization of the Bubble Sort algorithm using the graphics.h
library in C++.
- Visualizes sorting of 200 elements
- Uses colored lines to show comparisons and swaps
- Supports randomized, reverse-sorted, or sorted inputs
- Ideal for learning sorting visually
- Turbo C++ / WinBGIm-supported compiler (e.g., Dev-C++ with graphics.h support)
- Windows OS or compatibility layer for graphics
- Each element is shown as a vertical line
- White: element height
- Green: current comparison
- Black: clearing swapped lines
Random array
Reverse sorted array
g++ bubble_sort_visualization.cpp -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 -o BubbleSortVisualizer
./BubbleSortVisualizer