This surprisingly made this easy to remember for me. Unfortunately, the merge sort instructions doesn't make sense to me, specifically step 3.
Quicksort explained IKEA-style
61–70 of 142 posts
Re: Quicksort explained IKEA-style
#62This surprisingly made this easy to remember for me. Unfortunately, the merge sort instructions doesn't make sense to me, specifically step 3.
It's not a merge sort, it's just a partition. Mark every element greater than your pivot as "move right". Then step 4 marks every smaller element as "move left". Step 5 actually does that. You don't really need to split that into 3 steps, though it looks a bit more like a real IKEA diagram with the extra steps.
Re: Quicksort explained IKEA-style
#63I think a much better explanation would be to just say that it partitions the values into a lower and higher half. Then it recursively does the same thing to each half. After that you just have to understand exactly how partitioning works and get the ranges correct.
Re: Quicksort explained IKEA-style
#64Seeing a random Ö hurts my Swedish brain. Especially when "Sort" is Swedish already.
Re: Quicksort explained IKEA-style
#65Earlier quoted context omitted.
Well, to the extent a picture can explain they say choose at random. That's what the dice shown is about. A random pivot is... fine. It can't solve the worst case perf problem, and it won't ensure high performance for other cases either, but hey you did pick a pivot and this algorithm is often fast enough.
I'm talking about step 5. The elements just magically migrate to the correct position, whereas in the real algorithm they would be moved individually.
I think maybe Lego would cut away to show one layer of repetition for example.
Re: Quicksort explained IKEA-style
#66I think a much better explanation would be to just say that it partitions the values into a lower and higher half. Then it recursively does the same thing to each half. After that you just have to understand exactly how partitioning works and get the ranges correct.
How do you decide which weight to use to create two halves?
There are a number of strategies but random will indeed work and is simple to explain.
Re: Quicksort explained IKEA-style
#67I think a much better explanation would be to just say that it partitions the values into a lower and higher half. Then it recursively does the same thing to each half. After that you just have to understand exactly how partitioning works and get the ranges correct.
How do you decide which weight to use to create two halves?
Re: Quicksort explained IKEA-style
#68I agree, IKEA instructions are great. A bit related are railroad diagrams, like the one of the JSON syntax [2]. I worked on Rubik's cube solving instructions for beginners [1] (for my children initially), but then I found it would be so much better if the instructions are IKEA style. (Then I vibe-coded a Rubik's cube 2D and 3D model, and now I stopped working on this. Something for later.) For the cube, I want to imp…
They are until you hit one for something that is so simple it does not really need instructions, then you will end up in a tail spin! We bought a window shade puller thing and it had instructions!
Lego are also superb at instructions, for obvious reasons. I've put together a couple of modern Lego models with a lot of pieces and they are still as good as I remember 40+ years ago. I have to say that the model of the Chinese Year of the Dragon beastie from 2024? was pretty tricky.
Re: Quicksort explained IKEA-style
#69Earlier quoted context omitted.
I ignored the arrows and interpreted it as "move all elements lower than the marker in order to the left of the marker, and move all elements higher than the marker in order to the right of the marker". It's not clear, but if you use a bit of intuition you can come to this conclusion. Personally it took me about 5 seconds.
Have you ever learnt about Quicksort? If so, it might give you an edge on what to expect.
Re: Quicksort explained IKEA-style
#70Earlier quoted context omitted.
Well, to the extent a picture can explain they say choose at random. That's what the dice shown is about. A random pivot is... fine. It can't solve the worst case perf problem, and it won't ensure high performance for other cases either, but hey you did pick a pivot and this algorithm is often fast enough.
I'm talking about step 5. The elements just magically migrate to the correct position, whereas in the real algorithm they would be moved individually.