Algorithms
21 algorithm pages — sorting, searching, transforming, numeric, set operations, and parallel execution.
std::binary_search, lower_bound, upper_bound, equal_range and partition_point: logarithmic search over sorted ranges, with ranges variants, comparators and pitfalls.
Reduce a range to a single value using std::accumulate, std::reduce, std::transform_reduce, and the C++23 ranges::fold family.
Algorithms for creating, maintaining, querying, and sorting heap-ordered ranges in-place using random-access iterators.
std::lexicographical_compare and its C++20 siblings: dictionary-order comparison of two ranges, custom comparators, parallel overloads, and three-way results.
Complete guide to std::min, std::max, std::minmax, clamp, and their range-element variants—signatures, version history, pitfalls, and idiomatic C++20 usage.
STL algorithms from <algorithm> that mutate a target range by copying, filling, generating, transforming, replacing, or rearranging elements.
C++ non-modifying algorithms — for_each, count, count_if, any_of, all_of, none_of, find, find_if, mismatch, equal, and their C++20 ranges equivalents.
Complete reference for C++ numeric algorithms: accumulate, reduce, transform_reduce, prefix scans, gcd, lcm, midpoint, lerp, and parallel variants.
C++17 execution policies for STL algorithms — par, par_unseq, reduce, transform_reduce, scan, thread safety, and platform requirements.
Reorder, inspect, and copy elements based on a predicate with std::partition and its companion algorithms.
Generate and enumerate lexicographic permutations, check range equivalence, and randomly shuffle sequences using the C++ Standard Library.
"C++20 ranges and views: range concepts, lazy view adaptors, composable pipelines, projections, and the pitfalls that bite experienced engineers."
Prefix-sum algorithms in <numeric>: partial_sum (C++98) and the parallel-capable inclusive_scan, exclusive_scan, and transform variants added in C++17.
C++ searching algorithms — std::find, binary_search, lower_bound, upper_bound, equal_range, search, and C++20 ranges equivalents with projections.
Set algorithms operating on sorted ranges and heap operations — multiset semantics, complexity guarantees, and C++20 ranges versions.
"C++ sorting: std::sort, std::stable_sort, std::partial_sort, std::nth_element, ranges variants, custom comparators, and strict weak ordering."
Merge two sorted ranges into a single sorted output range. Both std::merge and std::inplace_merge are stable and have been available since C++98.
Select n elements uniformly at random without replacement from a population range, preserving their relative order.
Complete guide to <algorithm> and std::ranges algorithms — sorting, searching, transforming, partitioning, and parallel execution.
Deep reference for std::transform, for_each, copy, fill, generate, remove, rotate, and C++20 ranges equivalents with pitfalls and best practices.
Low-level algorithms for constructing, copying, moving, and destroying objects in raw allocated storage, decoupling allocation from object lifetime management.