
Sorting Algorithms Revisualized - mdturnerphys
https://imgur.com/gallery/GD5gi
======
mordechai9000
This brings back something I had all but forgotten. The first ever assembly
language program I got to run was a bubble sort implementation that sorted the
text characters on the screen. I painstakingly typed it in from a book on 6809
assembly language programming. I didn't know what it was going to do, so I was
blown away when I saw how it could actually manipulate and sort characters in
video memory right before my eyes.

------
mrguyorama
The problem with colorblindness is a common one. I saw the post in question
and it was just a typical rainbow color scheme, and it never even occurred to
me that they might cause trouble for color blind users.

Is it possible to map the RGB colorspace onto a colorblindness safe
colorspace? This would be a cool feature that I feel Web Browsers could
provide to be more accessible for their users

~~~
gsich
Not really. Colorblindness affects 0.001% of the population. (but that's
wikipedia)

~~~
Franciscouzo
From wikipedia:

"Red–green color blindness affects up to 8% of males and 0.5% of females of
Northern European descent."

That's around 4% of the population, not 0.001%.

~~~
gsich
That's red-green color deficiency, not "colorblindness" as in "I only see
grayscale". The english wikipedia says it's about 0.025% of the population
[0]. So I'll take that instead of the german one.

[0]
[https://en.wikipedia.org/wiki/Achromatopsia](https://en.wikipedia.org/wiki/Achromatopsia)

~~~
fao_
> That's red-green color deficiency, not "colorblindness"

from The Free Dictionary:

"Noun. 'color blindness' \- genetic inability to distinguish differences in
hue"

and from
[https://en.wikipedia.org/wiki/Color_blindness](https://en.wikipedia.org/wiki/Color_blindness)

"Color blindness, also known as color vision deficiency, is the decreased
ability to see color or differences in color.[2]

[...]

Red–green color blindness is the most common form, followed by blue–yellow
color blindness and total color blindness.[2] Red–green color blindness
affects up to 8% of males and 0.5% of females of Northern European
descent.[2]"

Your very specific definition of colour blindness (i.e. 'colour blindness' =
'Achromatopsia') does not seem to be represented in the colloquial usage. Thus
the parent of you is correct.

~~~
gsich
He's not. I don't know why people assume that red-green color
blindness/deficiency is equal to colorblindness. Because it's not. There is no
need to save characters or be imprecise on this matter. Sure it may be used.
But it's still a wrong usage. If you mean red/green say it. Otherwise it is
not clear what is meant, and of course I'll assume total color blindness.
Although, in german there are two words for this. "Rotgrünschwäche" and
"Farbenblind". The first one is red/green, the other one total. People usually
don't use both for different meanings.

~~~
fao_
> But it's still a wrong usage.

There is no such thing as "correct" in language, except in Europe where one or
two countries have official standards (e.g. France). For English there is only
colloquial usage and _maybe_ the Oxford English Dictionary (Which 99% of the
time agree with each other). Both of them state that "Color-blindness" is the
accepted term referring to all conditions related to color deficiency.

> People usually don't use both for different meanings.

And welcome to English, where we have one word that encompasses any color-
deficiencies, and we call that word "color-blindness".

It is used as a blanket term for any color-deficiency, including but not
exclusive to red-green, yellow-blue, and monochrome vision. I can tell you
now, that _as a native English speaker_ , if you were to talk about "color
blindness" to another native speaker, they will not assume that you mean
Monochromacy specifically. In fact, they are more likely to think that you
mean red-green color-blindness, since that is more common than Monochromacy.
In any case, it is _extremely rare_ to find usage that matches yours.

(Literally. The first reference in the Oxford English Dictionary is to
Protanopia, not Monochromacy:
[https://en.oxforddictionaries.com/definition/colour-
blind](https://en.oxforddictionaries.com/definition/colour-blind))

------
vanderZwan
I have protanomally and saw the original post, and I didn't even think about
the rainbow map. It was very informative still. However, the pixels are _so_
much easier to follow in the new version! Guess I am so used to being
"deprived" of full information that I didn't even realise what I was missing!

------
em3rgent0rdr
Wouldn't the gif for Bogosort be humongous, because it has to try all possible
permutations? Maybe this article is just using random noise gif instead for
size concerns.

~~~
anyfoo
Bogosorting an array of the given size would take much longer than the
lifetime of our sun. You think the author might not have given us the full gif
depicting that sort? I don't know!

~~~
em3rgent0rdr
right, that is my point! I made my comment because I feel the author was being
misleading about just how much a "long time" and by falsely suggesting that
the animation he put up for it was real and not just random noise.

~~~
anyfoo
I feel like he made a joke.

------
em3rgent0rdr
Would be nice to see a visualization that took into account real computer
performance concerns such as caching, branch prediction, and instruction-level
parallelism.

------
Sharlin
Ahh, this is so much better. I'm red-green colorblind but I'd have thought
that using the "rainbow" color wheel gradient wasn't very intuitive to people
with normal color vision either. Given two hues it isn't intuitively obvious
which hue is "greater" (as is evident from the fact that people have to
memorize the order of the colors in a rainbow), plus the scale wraps around
perceptually (as the term "color wheel" implies) so it isn't even a proper
total order.

------
minimaxir
Here’s a good writeup on the benefits of using the viridis palettes for data
visualization, using examples in R:
[https://cran.r-project.org/web/packages/viridis/vignettes/in...](https://cran.r-project.org/web/packages/viridis/vignettes/intro-
to-viridis.html)

------
avyfain
Every time something like this comes up, I think of Mike Bostocks wonderful
Visualizing Algorithms[0]. The essay is not comprehensive, but shows more than
just sorting. It also deals with sampling, and with maze generation. Truly
worth your time.

[0]:
[https://bost.ocks.org/mike/algorithms/](https://bost.ocks.org/mike/algorithms/)

------
caspervonb
Neat, made my own a few weeks back, It's in JavaScript tho so can't deal with
huge datasets, oh and there's sound.

\-
[https://caspervonb.github.io/toneofsorting/](https://caspervonb.github.io/toneofsorting/)
:-}

------
CyberDildonics
One thing to remember with these is that they don't show the speed of the
sorting algorithms because the movement of numbers is animated. If they are
written further away, the square of that color travels further, which takes
time.

------
Edmond
try: [http://schoolnotez.com/](http://schoolnotez.com/)

click on the computer science page to see the various sorting algos.

------
josh_blum
Really cool! Is the code available publicly?

~~~
Franciscouzo
It's not OP's, but I made a this [0], and the code is available here [1]

[0]
[https://franciscouzo.github.io/sort/](https://franciscouzo.github.io/sort/)

[1]
[https://github.com/franciscouzo/franciscouzo.github.io/tree/...](https://github.com/franciscouzo/franciscouzo.github.io/tree/master/sort)

~~~
josh_blum
Thank you!

------
fastball
Why is imgur so magnified on my desktop? It's horrible. I can't even see an
entire gif at one time on my screen.

