The key to step 3 (of the merge sort) is the little nx in the middle that tells you to repeat step 3 n times. Each time, you take a right or left branch based on if the new weight from the half plank is lighter or heavier than the current weight.
You also have to understand that step 1 means you recursively merge sort each half before you merge the two sorted halves.
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.
NetMageSCW|5 months ago
jfengel|5 months ago
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.
NetMageSCW|5 months ago