Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint: stable partition

โญโญ intermediateโณ 25 min read๐Ÿ“ Lesson 104 of 256

In-place reordering that preserves relative order โ€” compaction plus a pivot slot.

Stable partition = compaction (smaller values written forward) + parking the pivot + appending the remainder, all order-preserving. If your trace moved a value you did not expect, the write index and the read index were allowed to touch โ€” they must run on independent pointers. This is the exam's hardest plain-array shape and it decomposes into machines you have owned since Module 3.