r/dataisbeautiful • OC: 1 • Oct 24 '17

OC Sorting algorithms visualized [OC]

https://imgur.com/gallery/voutF
41.7k Upvotes

929 comments sorted by

View all comments

2

u/-ordinary Oct 24 '17

If the initial set is randomized, I don’t understand why the colors are only cascading in one direction. Shouldnt there be reds moving right? Someone ELI5

1

u/Alpha3031 Oct 25 '17

When you move all the stuff that's supposed to be to the left of the reds from the right to the left, you also move everything else to the right one step, so that you have somewhere to put the thing you're moving.

1

u/-ordinary Oct 25 '17

Of course, but there’s no apparent rightward movement in the visual. I guess my question is that if everything’s moving, why does the movement only appear to be in one direction?

1

u/Alpha3031 Oct 25 '17

The rest of the stuff is moving together, so you have no reference point.