Let's use the given algorithm on {3,1,5,2,4}.
First number is 3. Our partition is {3},{}.
Next comes 1. We can't add that to {3}, so we add it to the other: {3},{1}.
Next comes 5. We will add it to {3}, so as to save the {1} for smaller numbers: {3,5},{1}.
Next comes 2. we must add it to {1}: {3,5},{1,2}. (Now we see why it was good not to add 5 to {1}.)
Next comes 4: again, we have no choice: {3,5},{1,2,4}.