Live data from Hacker News

Quicksort explained IKEA-style

idea-instructions.com

1–10 of 142 posts

Re: Quicksort explained IKEA-style

#3
post #2

This is so cool! Not only is the design similar, but just like the real IKEA instructions, I can't understand them! This is as realistic as it gets.

Missing the instruction panel where the customer is attempting to follow the baffling instructions and has to use a wired phone to call the store for help.

Getting quicksort's boundary conditions right (avoiding off-by-one errors, infinite recursion, etc.) can be tricky.

Another popular algorithm that can be hard to get right is binary search.

Re: Quicksort explained IKEA-style

#4
post #2

This is so cool! Not only is the design similar, but just like the real IKEA instructions, I can't understand them! This is as realistic as it gets.

at best I can see trouble in interpreting "throw cube and shade a bar" as "choose randomly"

but if you don't understand it at all... I have bad news for you

Re: Quicksort explained IKEA-style

#5
post #2

This is so cool! Not only is the design similar, but just like the real IKEA instructions, I can't understand them! This is as realistic as it gets.

at best I can see trouble in interpreting "throw cube and shade a bar" as "choose randomly" but if you don't understand it at all... I have bad news for you

Would be better if the die had lettered sides that matched up to the bar positions. With "3" it's hard to be certain it's the bar position and not the height.

Re: Quicksort explained IKEA-style

#6
post #2

This is so cool! Not only is the design similar, but just like the real IKEA instructions, I can't understand them! This is as realistic as it gets.

at best I can see trouble in interpreting "throw cube and shade a bar" as "choose randomly" but if you don't understand it at all... I have bad news for you

I can understand it after some deciphering, but I think that’s only because I already know quicksort. I’d be interested in seeing if anyone new to sorting algorithms finds it illuminating.

Then again, maybe that’s not important to the author - it is a pretty funny illustration to those in the know.

Re: Quicksort explained IKEA-style

#7
post #6

Earlier quoted context omitted.

at best I can see trouble in interpreting "throw cube and shade a bar" as "choose randomly" but if you don't understand it at all... I have bad news for you

I can understand it after some deciphering, but I think that’s only because I already know quicksort. I’d be interested in seeing if anyone new to sorting algorithms finds it illuminating. Then again, maybe that’s not important to the author - it is a pretty funny illustration to those in the know.

I'm a programmer (after a fashion) but I don't know how quicksort works.

This is how I understand it after reading these instructiöns, without looking up any further explanation:

1. Choose a random element as the 'center' point of the sort

2. That element defines the maximum 'height' (value)

3. Anything that is larger than that value, is moved to the right side of the 'center'

4. Anything that is smaller than that value, is moved to the left side of the center. After this, the array is partially sorted.

5. The sorting process is repeated on both 'sides' independently, picking a new random center element and so on

What isn't clear, is how often the process needs to be repeated, or when the algorithm 'knows' that the sorting has been finished - surely it can't be just three iterations?

By now I've already looked up how the algorithm actually works, but the above is what I got out of the illustration :)

Re: Quicksort explained IKEA-style

#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.

Re: Quicksort explained IKEA-style

#9
post #6

Earlier quoted context omitted.

I can understand it after some deciphering, but I think that’s only because I already know quicksort. I’d be interested in seeing if anyone new to sorting algorithms finds it illuminating. Then again, maybe that’s not important to the author - it is a pretty funny illustration to those in the know.

I'm a programmer (after a fashion) but I don't know how quicksort works. This is how I understand it after reading these instructiöns, without looking up any further explanation: 1. Choose a random element as the 'center' point of the sort 2. That element defines the maximum 'height' (value) 3. Anything that is larger than that value, is moved to the right side of the 'center' 4. Anything that is smaller than that va…

Yeah, that's about it. Personally, I'm not sure I'd get this much out of the picture, but you can see the information is there.

> surely it can't be just three iterations?

To save others a search: you stop when the remaining sub-arrays are sorted by definition (ie. [] or [x]/size of 0 or 1).

Post reply on HN