I kind of get it, but just like Ikea instructions, you start second guessing yourself, then you realize, its BACKWARDS after you flip back 5 pages in when something doesn't fit.
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.
This is cool, but missing a LOT of details between steps 4 and 5, which is the meat of the quicksort. Actually, the first and last elements of step 4 would be swapped, which means the order depicted in step 5 is incorrect.
I 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 implement the algorithm, and then from the program create IKEA instruction (or a mix of IKEA and railroad diagram). That way I can be sure I didn't skip any steps in the instructions.
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
Step 4 is that one step you have to move all the pieces around repeatedly to match the paper until you realize one them is upside down and the other side is lightly sanded.
I 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.
I’ve just completed reading all 8 posters on the site. For some reason I find them easier to understand than any written content, code or math. They are all intuitive. It was fun and engaging to solve their notation and meaning they want to convey. The one with AVL trees was the most useful to me.
It should be possible to better explain in IKEA style how to perform partitioning with swapping. In its current form it can make people fall into a quadratic complexity trap.
I was confused by step (3). The right pillar doesn't need to move right because it's already to the right of the chosen pillar.
I guess what it's trying to say is just "mark it as needing to be to the right", and then do the opposite in (4) and then (5) is where things actually move.
46 comments
[ 3.2 ms ] story [ 74.2 ms ] threadbut if you don't understand it at all... I have bad news for you
1) Pick a random (dice roll) pivot
5) Move all values less than pivot before it, all greater than after it
6) Recurse to sort elements before & after pivot
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 implement the algorithm, and then from the program create IKEA instruction (or a mix of IKEA and railroad diagram). That way I can be sure I didn't skip any steps in the instructions.
[1] https://github.com/thomasmueller/rubiks/blob/main/README.md
[2] https://www.json.org/json-en.html
[1]: quicksort is shown here, but the channel has plenty of others https://youtu.be/3San3uKKHgg
After that you just have to understand exactly how partitioning works and get the ranges correct.
Unfortunately, the merge sort instructions doesn't make sense to me, specifically step 3.
Quick sort with Hungarian, folk dance
https://www.youtube.com/watch?v=3San3uKKHgg
I guess what it's trying to say is just "mark it as needing to be to the right", and then do the opposite in (4) and then (5) is where things actually move.