Imagine these glowing circles are bubbles floating in a line. Right now, they are all mixed up! We want to organize them from smallest to biggest.
We look at two neighbors. The Left Bubble (24) asks the Right Bubble (8): 'Hey, am I bigger than you?'
Yes! 24 is bigger than 8. The big bubbles belong on the right side, so they have to swap spots. SWOOSH!
We keep checking neighbors. The biggest bubble (42) is like a heavy rockāit keeps swapping until it sinks all the way to the end of the line.
Hooray! The biggest bubble (42) made it to the very end. It turns purple because it is 'locked' in its perfect safe spot. It won't move again.
We do this again and again for the rest of the bubbles. Eventually, everyone finds their spot, and the line is perfectly organized!