Interactive Visualization
Watch selection sort work in real-time. The visualizer shows each selection and swap.
Selection Sort Visualization
1x
What to Observe
As you watch the visualization, notice:
- Selection: Minimum element is highlighted
- Comparison: Elements are compared to find minimum
- Swap: Minimum is swapped to correct position
- Sorted portion: Grows from left to right
- Unsorted portion: Shrinks with each pass
Understanding the Colors
- Green: Elements in sorted portion
- Red/Orange: Current minimum being selected
- Blue: Elements being compared
- Default: Unsorted elements
Try Different Arrays
The visualizer starts with [10, 50, 30, 20, 40]. Notice how:
- Each pass finds the minimum
- Only one swap per pass
- Sorted portion grows systematically
What’s Next?
Now that you’ve seen it work, let’s implement selection sort in code.
Progress 43%
Page 3 of 7
← Previous
→ Next