Live data from Hacker News

Quicksort explained IKEA-style

idea-instructions.com

81–90 of 142 posts

Re: Quicksort explained IKEA-style

#81
post #80

My first thought was that it would be explaining Quicksort using an Ikea warehouse as a metaphor, to show how different algorithms suit different constraints. As for the actual Ikea-style instruction pamphlet... I suspect that making it was very helpful for the author. But I don't think the result would have helped me as a novice. It took some work for me to understand the diagram, and I've used Quicksort.

Sounds like they captured the IKEA manual experience very well!

Re: Quicksort explained IKEA-style

#82
post #80

My first thought was that it would be explaining Quicksort using an Ikea warehouse as a metaphor, to show how different algorithms suit different constraints. As for the actual Ikea-style instruction pamphlet... I suspect that making it was very helpful for the author. But I don't think the result would have helped me as a novice. It took some work for me to understand the diagram, and I've used Quicksort.

For me the key was just application to figuring out if any cards are missing in a deck by sorting it.

Assume spades In your first pass, divide the deck into black and red cards. Then divide black into spades and clubs. Then divide spades into 7. Then insertion sort the cards 7, spades are now sorted. Clubs come next, divide into 7, insertion sort, and combine. Split diamonds and hearts, repeat with diamonds, repeat with hearts.

“What about the pivot thing?” Well, that's because we don't know the midpoint of our set in a typical sort. So instead you can just grab a random card and then go through the deck to find all cards < that card. If you want slightly fewer passes, use median of three.

Re: Quicksort explained IKEA-style

#83
post #44
post #19

If we're willing optimize for aesthetic over ability to help understand, I'll nominate demonstration via Hungarian Folk Dance[1] as a candidate for the best medium to depict sorting algorithms, which I first saw during a lecture years ago when the professor pulled up on of the videos to show us in class [1]: quicksort is shown here, but the channel has plenty of others https://youtu.be/3San3uKKHgg

So what is the best algorithm when you have a bunch of people and want them sorted in order of, say, birthday.

Tell them to make sure the person in front of them has a birthday before theirs. If not, keep jumping back the line until they do.

Practical CS theory isn’t really relevant here because it is N-parallel for N people.

Re: Quicksort explained IKEA-style

#84
post #8

If I didn't know how quicksort works - and I had to learn, since for some reason in FP languages quicksort is typically next after "hello world" - I would struggle to make sense of the pictures, I think. However, it's absolutely brilliant as a memory refresher: it packs so much info in so little space that it's insanely efficient. I imagine it would pair well with a good textbook on algorithms.

Step six: draw the rest of the fucking owl.

Yeah this is lousy. This wouldn’t teach anyone anything.

Re: Quicksort explained IKEA-style

#85
post #8

If I didn't know how quicksort works - and I had to learn, since for some reason in FP languages quicksort is typically next after "hello world" - I would struggle to make sense of the pictures, I think. However, it's absolutely brilliant as a memory refresher: it packs so much info in so little space that it's insanely efficient. I imagine it would pair well with a good textbook on algorithms.

> for some reason in FP languages quicksort is typically next after "hello world" Because the recursive implementation is surprisingly straightforward and concise, and more-less demonstrates what the whole paradigm is about. As much as I hate to admit it, it's a good learning artifact.

It’s straightforward to a programmer. Who doesn’t need an ikea diagram in the first place.

This is why developer docs are trash. Because 90% of us can’t even identify when we are talking over everyone’s heads.

Re: Quicksort explained IKEA-style

#89
This was actually a really neat refresher.

The name feels like such a near miss though... Kvick (beyond being my surname) does mean quick and I see they changed to it from kwick to make the title "more Swedish". Great! But sört? That's not a Swedish word and feels very "trying to seem Swedish without knowing any Swedish". That letter would be pronounced somewhat like the u in blur.

Meanwhile sort in Swedish is sortera. Sort itself does mean sort as in kind/type. So perhaps Kvick Sort would be the best version of the name?

Re: Quicksort explained IKEA-style

#90

Nice! KVICK SÅRT, would be the most correct swenglish title though.

I think sort would be even better because it's less Swenglish. It's the base for sorting in Swedish (sortera) after all. Sört does really bother me since it sounds so wrong (almost like the u in blur). Sårt use closer to how Swedes would pronounce the English word sort, that's true.

At least they changed the first word to Kvick because it means the right thing and sounds about right. And it happens to be my family name.

Post reply on HN