#stable-partition
Wiki
›
Algorithms
›
02. Data Structures
›
1. Core Data Structures and Operations
›
1.1 Arrays and Dynamic Arrays
›
Stable Partition
Stable Partition Stable partition rearranges an array so that elements satisfying a predicate appear before the others, while preserving relative order inside both groups. You use it when grouping is required but original order still carries meaning. Problem Given an array $A$ of length $n$ and a predicate $P(x)$, reorder the array so that: all elements satisfying $P$ appear first all elements not satisfying $P$ appear after them relative order...