Parcel 305 jumps the queue.
transcript
This belt is grouped correctly. And the loading team is still unhappy. Watch one swap.
Five parcels, codes 301 to 305. Their classes are two, one, zero, one, zero. Parcels of one class must stay in arrival order.
Mid sees parcel 301. It is economy. It swaps with parcel 305 at high. Parcel 305 lands at the front, ahead of 303.
Parcel 303 arrived before 305. After the flag, 305 comes first. One swap jumped it over its own class.
A swap with high reaches across the belt. It does not care who is in between. So a parcel can pass others of its own class. Grouping is still correct. Arrival order is not kept.
Sometimes order inside a group does not matter. Classes alone have no identity to keep. But bids in an auction are read as a timeline. There, a parcel or bid jumping ahead is a bug.
The Dutch national flag is not stable. When order matters, count each group first. Then copy each parcel to its group's next free slot. That costs extra memory, but keeps the order.
Full breakdown in the lecture.