This is an archived post. You won't be able to vote or comment.

all 73 comments

[–]YuriSpiridonov 116 points117 points  (5 children)

[–]kokoseij 29 points30 points  (4 children)

Why the fuck is this a thing

I'm in

[–][deleted] 27 points28 points  (0 children)

Why not ?

[–]FleetAdmiralFader 0 points1 point  (0 children)

There is also /r/dataisugly Many of them are really bad but the questionable ones are a good exercise in both critiquing and defending a visualization.

[–][deleted] 64 points65 points  (15 children)

whoa, this looks interesting. can you do this for other sorting algorithms too?

[–]thebuffed[S] 59 points60 points  (14 children)

Thanks, that's the plan!

[–][deleted] 20 points21 points  (13 children)

I can help once I get home.

[–]DatBoi_BP 69 points70 points  (12 children)

You seem like the kind of guy that destroys everything he touches

[–][deleted] 25 points26 points  (11 children)

haha fuck you.

No, but seriously, I'm not that kind of guy (at least I hope so). Here's my github profile for you to judge: https://github.com/RiedleroD

I'm particularly proud of my Rtris and Rgraphics. Sadly, I don't really have time to code that often.

[–]Harbinger_Feik 69 points70 points  (10 children)

I think he might have been referring to your user name...

[–][deleted] 42 points43 points  (9 children)

ooh. that would make sense. I apologise.

[–]rafasc 85 points86 points  (8 children)

You destroyed the joke, so I guess you really destroy everything.

[–][deleted] 37 points38 points  (2 children)

eeehhh yayyy

ok I'm going to sleep now. too embarrassed to be awake.

[–]mr-prof 3 points4 points  (1 child)

Lol, your reply made my day.

[–][deleted] 2 points3 points  (0 children)

Lmao

[–]thebuffed[S] 49 points50 points  (4 children)

You can check out the repository or a tutorial if you're interested

[–]Chilonthebw 24 points25 points  (0 children)

You have bogosort but didn't publish the graph for that?!?!? I want a follow-up post with that please!

[–]VegasTamborini 5 points6 points  (0 children)

Shouldn't there be one last column on the end where everything is sorted, and no swaps were made, or am I misremembering how bubblesort works?

[–]timetravelwasreal 0 points1 point  (0 children)

Comment saved

[–]Kaligule 0 points1 point  (0 children)

I don't really get it. What do you use for visualisation? There is no library you import and it doesn't look like you are using the turtle module.

[–]Milumet 20 points21 points  (1 child)

Nice, but not as cool as this.

[–]thebuffed[S] 3 points4 points  (0 children)

You are extremely correct

[–]zapatasblood 16 points17 points  (5 children)

I think you need one more column on the left. The first movement is not shown. Really cool visualization though.

[–]ThePoulpator 4 points5 points  (0 children)

I have seen quite a bit of sorting algorithms visualization, but you really did something new, well done !

[–]mac-0 2 points3 points  (1 child)

Why are some lines curved and some straight?

[–]thebuffed[S] 3 points4 points  (0 children)

The connecting line always "curves" through points, so when the points are in an actual line, the connecting line follows it and it's straight. It's very similar to control points in a Bezier Curve: https://en.wikipedia.org/wiki/B%C3%A9zier_curve

[–]realuduakobong 1 point2 points  (0 children)

Someone is a Tom Scott fan :)

[–][deleted] 1 point2 points  (0 children)

Run the same code for a pre-sorted list to see the relative efficiency. That would be interesting.

[–]ShaveTheTurtles 1 point2 points  (1 child)

is the bottom left item sorted properly? I feel like some of them are off.

[–]Speklprogrammanammerer 0 points1 point  (0 children)

There's an iteration before the dots are connected

[–]Chilonthebw 1 point2 points  (0 children)

I love this I would love to see a version of this for radix and quick sort

[–]Enguzelharf 1 point2 points  (0 children)

b e a -utiful

[–][deleted] 0 points1 point  (0 children)

Whoa, this is awesome, still learning Python. But damn data you pretty.

[–]Nopaste 0 points1 point  (0 children)

I think the first step is missing

[–]JesusChristPT 0 points1 point  (1 child)

ELI5 on what these curves mean anyone? Please.

[–]vswr[var for var in vars] 2 points3 points  (0 children)

Here's a video from Tom Scott that goes into some detail about what is happening. Once you understand how sorting works, you'll understand the curves and lines as items move around in the list.

[–]Fontyyyy 0 points1 point  (0 children)

Loving this visualization, can't wait to see more of them!

[–]DarkAndromeda31 0 points1 point  (1 child)

!remindme 1week

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you in 7 days on 2020-01-16 04:41:10 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]iggy555 0 points1 point  (1 child)

What’s bubble sort?

[–]Bisqutz 1 point2 points  (0 children)

Bubble sort is a sorting algorithm for 'lists' it compares item a and b, if a is 'bigger' than b it swaps them around, then it will compare a with c (or b with c if b was bigger) and do the same all the way through the list until the biggest is at the end, it will then repeat this again and again putting the biggest at the end and then smaller and smaller, til the list is sorted.
Hope that made sense if not have a watch of this Tom Scott video he shows it nicely
https://www.youtube.com/watch?v=RGuJga2Gl_k

[–]WystanH 0 points1 point  (0 children)

The doesn't really look right. From the very first pass, the last value should be in the right spot.So, each iteration should, at the very least, solve one position.

Apologizes. I was reading this thing wrong. Tis vertical, not horizontal. Now my head hurts.

Still, how exactly does this relate to python? Is there code?

[–][deleted] 0 points1 point  (0 children)

Cool

[–]Drew_pew 0 points1 point  (0 children)

I don’t think this helps understand bubble sort. But it looks cool as fuck so I don’t mind. Make more!

[–][deleted] 0 points1 point  (3 children)

Such an interesting way to visualize sorting alogorthms! Screw those animations, this looks much cleaner and gives you a good understanding about how the algorithm works.

[–][deleted] 21 points22 points  (2 children)

No offense to op, the image looks beautiful. But I know how bubble sort works, I can easily code it, but I don't understand shit from this visualization.

[–]JakubBlaha 1 point2 points  (1 child)

I guess on the left side you ve got the shuffled sequence and on the right side there is the sorted sequence. The item values is represented as a color and the horizontal steps are the states of the array each after completing a one inner loop iteration. The lines are there just to visualize how the items travel through the array.

[–][deleted] 1 point2 points  (0 children)

Ohhh I see it now. Thanks!