Search⌘ K

Partition

Explore how to apply partition algorithms in C++ to split data ranges according to unary predicates. Understand the differences between std::partition and std::stable_partition, learn to check partitions with std::is_partitioned, retrieve partition points, and copy partitions using the standard library functions. This lesson equips you with foundational knowledge to manipulate and analyze subsets within collections efficiently.

We'll cover the following...

ℹ️ What is a partition?
A partition of a set is a decomposition of a set into subsets such that each element of the set is precisely in one subset. The subsets are defined in C++ by a unary predicate so that the members of the first subset fulfill the predicate. The remaining elements are in the second subset. ...