August 2012
Intermediate to advanced
976 pages
30h 17m
English
The sorting and partitioning algorithms provide various strategies for ordering the elements of a sequence.
Each of the sorting and partitioning algorithms provides stable and unstable versions (§ 10.3.1, p. 387). A stable algorithm maintains the relative order of equal elements. The stable algorithms do more work and so may run more slowly and use more memory than the unstable counterparts.
A partition divides elements in the input range into two groups. The first group consists of those elements that satisfy the specified predicate; the second, those that do not. For example, we can partition elements in a sequence based on whether the elements are odd, or on whether a word ...
Read now
Unlock full access