Mental Model
We separate three groups of colors by moving pointers from left and right, swapping as needed to put all reds, whites, and blues in order.
Analogy: Imagine sorting three types of balls (red, white, blue) on a table by pushing reds to the left, blues to the right, and whites stay in the middle, using two hands moving inward.
Index: 0 1 2 3 4 5 Array: [2] [0] [2] [1] [1] [0] Pointers: low ↑ high ↑ current ↑
