r/ProgrammerHumor • • Mar 16 '20

Sort algorithm

65.4k Upvotes

614 comments sorted by

View all comments

137

u/ChaosOS Mar 16 '20

Why aren't the cups in roygbiv order?

150

u/RainbowDarter Mar 16 '20

The table needs to be reindexed.

28

u/jasmin3dragon Mar 16 '20

Or it’s a hash index. So the order of the buckets doesn’t matter. You just have to search for exactly one color only, then you can find it super quick.

0

u/[deleted] Mar 16 '20

[deleted]

16

u/greenearrow Mar 16 '20

It would make for three lessons at once at that age. Starts with bigger/smaller spatial reasoning, shifts into color spectrum, and then letters to understand ROY G BIV.

→ More replies (1)

6

u/hate_picking_names Mar 16 '20

We have two sets of similar cups at home (both of our sets are from the same place, but they are different than the ones in the video) and the colors don't match between the sets. If I had to guess, they might just make all sizes (or several sizes) with a bunch of colors and you get what you get.

→ More replies (9)